New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: accept empty KUBE_DOCKER_IMAGE_TAG #80185
Conversation
/assign @cblecker |
/test pull-kubernetes-e2e-gce |
Some tests: KUBE_DOCKER_REGISTRY=gcr.io/my-project make quick-release |
/priority important-soon |
/approve |
build/lib/release.sh
Outdated
if [[ -n "${KUBE_DOCKER_IMAGE_TAG-}" && -n "${KUBE_DOCKER_REGISTRY-}" && $docker_registry != $KUBE_DOCKER_REGISTRY ]]; then | ||
release_docker_image_tag="${KUBE_DOCKER_REGISTRY}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG}" | ||
if [[ -n "${KUBE_DOCKER_IMAGE_TAG-}" || -n "${KUBE_DOCKER_REGISTRY-}" ]]; then | ||
release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing these inline substitutions, could set do something like:
KUBE_DOCKER_REGISTRY="${KUBE_DOCKER_REGISTRY-$docker_registry}"
That way, $KUBE_DOCKER_REGISTRY
will always have a value (either an explicit one, or a sane default), rather than doing these inline ones. I haven't looked through the rest of the if logic here, but it's obvious we need to clean some of this up and make it more easily understandable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, this is pretty tricky to follow 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about now?
I always generate release_docker_image_tag, it could be default values or ENV value.
It should always remote the docker_tag image. Releases are going to be tagged with release_docker_image_tag, which should be different that docker_tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, fejta, javier-b-perez The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubernetes-kubemark-e2e-gce-big |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When we build CI releases, they need to use the same docker tag for 'k8s.gcr.io' and for KUBE_DOCKER_REGISTRY. If we leave KUBE_DOCKER_IMAGE_TAG empty, it will use the same docker tag.
See #80184
Special notes for your reviewer:
If only KUBE_DOCKER_IMAGE_TAG is defined, and for some reason the value is the same as '$docker_tag', it will work because we can tag the image with the same name. The only difference, the image will be preserved at the end of the execution.
Does this PR introduce a user-facing change?: