Skip to content
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

Set effective version when building images #2500

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

timebertt
Copy link
Member

How to categorize this PR?

/area dev-productivity
/kind enhancement
/priority normal

What this PR does / why we need it:
With this PR, docker images built by make docker-images are tagged and build with a version including the commit hash (exactly like the images built by the pipeline).
This allows developers to build prerelease images with a correct version inside to evaluate a new release. E.g. the gardenlet uses the pkg/version.gitVersion to report its own version and to the deploy the same gardenlet image version into shooted Seeds.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Docker images built by `make docker-images` are now tagged and build with the commit hash appended to the version.

@timebertt timebertt requested a review from a team as a code owner June 24, 2020 11:58
@gardener-robot gardener-robot added area/dev-productivity Developer productivity related (how to improve development) kind/enhancement Enhancement, improvement, extension priority/normal labels Jun 24, 2020
Makefile Show resolved Hide resolved
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks fine.
I have some concerns about this change.
git rev-parse HEAD is the commit hash of the last commit which might be something already merged in the master branch, but not your local changes. With this said, before building the image, the changes needs to be committed to get their own commit hash. For example, if I am deploying from master and you build and push local image based on same commit from master, I will use your local changes instead of the current master.

@timebertt
Copy link
Member Author

Thanks for your comments, that's a valid concern 👍
I updated the Makefile to append -dirty to the EFFECTIVE_VERSION, if someone is building from a dirty tree.

@timebertt
Copy link
Member Author

Found a way to calculate the -dirty postfix in the Makefile.
@timuthy @rfranzke @vpnachev PTAL :)

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Member

@timuthy timuthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for implementing the "dirty" use-case 😄
/lgtm

@rfranzke rfranzke merged commit ffec3dc into gardener:master Jun 25, 2020
@timebertt timebertt deleted the hack/effective-version branch June 25, 2020 10:34
@gardener-robot gardener-robot added priority/3 Priority (lower number equals higher priority) and removed priority/3 Priority (lower number equals higher priority) labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev-productivity Developer productivity related (how to improve development) kind/enhancement Enhancement, improvement, extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants