vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
196 stars 193 forks source link

Updates to hack/gen-publish-images.sh don't take into account not needing a custom CA #2876

Open mbentley opened 2 years ago

mbentley commented 2 years ago

Bug description TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE must be set when running hack/gen-publish-images.sh.

Affected product area (please put an X in all that apply)

Expected behavior

The hack/gen-publish-images.sh script functions without TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE being defined

Steps to reproduce the bug

Set variables except for TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE, which is a valid use case; for example:

export TKG_IMAGE_REPO="projects.registry.vmware.com/tkg"
export TKG_CUSTOM_IMAGE_REPOSITORY="harbor.vmware.work.mbentley.net/tkg-airgapped-1.5.4"
export TKG_BOM_IMAGE_TAG="v1.5.4"

It will never hit https://github.com/vmware-tanzu/tanzu-framework/blob/main/hack/gen-publish-images.sh#L47-L57 unless you create an undefined variable for TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE. Based on how the other variables are handled here, I would not expect this behavior.

Version (include the SHA if the version is not obvious)

https://github.com/vmware-tanzu/tanzu-framework/blob/e3de5b1557d9879dc814d771f431ce8945681c48/hack/gen-publish-images.sh

Environment where the bug was observed (cloud, OS, etc) Any environment

Relevant Debug Output (Logs, manifests, etc)

$ ./gen-publish-images.sh > image-copy-list
./gen-publish-images.sh: line 47: TKG_CUSTOM_IMAGE_REPOSITORY_CA_CERTIFICATE: unbound variable
github-actions[bot] commented 2 years ago

Hey @mbentley! Thanks for opening your first issue. We appreciate your contribution and welcome you to our community! We are glad to have you here and to have your input on Tanzu Framework.

vuil commented 2 years ago

We should consider another label for issues pertaining to tooling,utilities, etc. For now, assigned to area/ux