rancher / charts-build-scripts

Apache License 2.0
9 stars 31 forks source link

If commit is wrong, make prepare does not fail #46

Closed manuelbuil closed 2 years ago

manuelbuil commented 3 years ago

I was using the following package.yaml:

url: https://github.com/k8snetworkplumbingwg/sriov-network-operator.git
subdirectory: deployment/sriov-network-operator
commit: v1.0.0
packageVersion: 01
additionalCharts:
  - workingDir: charts-crd
    crdOptions:
      templateDirectory: crd-template
      crdDirectory: templates
      addCRDValidationToMainChart: true

Suddenly, make prepare failed because a patch was not able to apply correctly, even though it was working yesterday. After investigating, I realized that even if make prepare did not throw any error, it was not cloning the repo with the tag v1.0.0 but master. If I modify the v1.0.0 with something obviously wrong like: commit: va76182b5f6f8a, make prepare works even though it ends up cloning master:

./bin/charts-build-scripts prepare
INFO[0000] Pulling k8snetworkplumbingwg/sriov-network-operator@va76182b5f6f8a1[path=deployment/sriov-network-operator] from upstream into charts 
INFO[0022] Loading dependencies for chart               
INFO[0022] Applying changes from generated-changes      
INFO[0022] Loading dependencies for chart               
INFO[0022] Copying CRDs from charts/crds to charts-crd/templates 
INFO[0022] Deleting charts/crds/k8s.cni.cncf.io_networkattachmentdefinitions_crd.yaml 
INFO[0022] Deleting charts/crds/sriovnetwork.openshift.io_sriovibnetworks.yaml 
INFO[0022] Deleting charts/crds/sriovnetwork.openshift.io_sriovnetworknodepolicies.yaml 
INFO[0022] Deleting charts/crds/sriovnetwork.openshift.io_sriovnetworknodestates.yaml 
INFO[0022] Deleting charts/crds/sriovnetwork.openshift.io_sriovnetworks.yaml 
INFO[0022] Deleting charts/crds/sriovnetwork.openshift.io_sriovoperatorconfigs.yaml 
INFO[0022] Adding templates/validate-install-crd.yaml to main chart 

I understand that the script does not work with tags and only with commits. But if I write a wrong commit, it would be good if it failed or threw a warning saying that because it can't find that commit, it will use master