-
Notifications
You must be signed in to change notification settings - Fork 170
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
show vsphere-cloud-controller-manager version in the log correctly #535
Conversation
I think this fix is a good start, but shouldn't the fix be passing the version into the Docker build command as a build arg instead of hard coding it? |
I think either works - using the fixed value and updating it when we have a new version released; or fetch the version value via git commands |
532c1c3
to
8b3746a
Compare
@@ -327,4 +327,5 @@ squash: | |||
docker-image: | |||
docker build \ | |||
-f cluster/images/controller-manager/Dockerfile \ | |||
-t "$(IMAGE):$(BRANCH_NAME)" . \ | |||
-t "$(IMAGE):$(BRANCH_NAME)" \ | |||
--build-arg "VERSION=${VERSION}" . \ |
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.
pass version info dynamically when building docker image
@@ -33,7 +33,7 @@ ARG DISTROLESS_IMAGE=gcr.io/distroless/static@sha256:9b60270ec0991bc4f14bda475e8 | |||
FROM ${GOLANG_IMAGE} as builder | |||
|
|||
# This build arg is the version to embed in the CPI binary | |||
ARG VERSION=unknown | |||
ARG VERSION=1.22.3 |
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.
for local development, if you run docker build
command without version info, the log is still not correct. Probably we can leave the fixed value and update it when we have a new release version
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lubronzhan, nicolehanjing 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 |
What this PR does / why we need it:
vsphere-cloud-controller-manager version is shown as ${VERSION} in the log:
we should see a version number instead of
${VERSION}
.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #533Special notes for your reviewer:
verified the fix:
Release note: