ROX-27488: Inject BUILD_TAG directly and rid of dirty check#13940
ROX-27488: Inject BUILD_TAG directly and rid of dirty check#13940
BUILD_TAG directly and rid of dirty check#13940Conversation
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 31774f1. To use with deploy scripts, first |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13940 +/- ##
==========================================
+ Coverage 48.85% 48.88% +0.02%
==========================================
Files 2496 2496
Lines 180733 180746 +13
==========================================
+ Hits 88306 88360 +54
+ Misses 85417 85371 -46
- Partials 7010 7015 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6ab63a8 to
ba6cde5
Compare
We used to rely on the Makefile which would run `git describe ...` and append MAIN|COLLECTOR|SCANNER_TAG_SUFFIX to that to derive the version for embedding in binaries. Instead, we can pass the exact version via the `BUILD_TAG` environment variable. This completely bypasses `git describe ...` and so it's also necessary for the proper git-tag support which is https://issues.redhat.com/browse/ROX-26026 Use of `BUILD_TAG` allows eliminating all *_TAG_SUFFIX variables which we introduced just to make Konflux builds with `-fast` suffix in version/tag deployable.
Because it's not always "main" image and because it makes things more straightforward, in my opinion, when ARG and ENV are called the same way.
Since versions/tags are provided directly and `git describe` isn't called, there should not be unintended `-dirty` suffixes and so `fail-build-if-git-is-dirty` isn't needed any more in containers. The similar dirty check is done in the task which produces versions/tags in the pipeline since https://github.com/stackrox/konflux-tasks/pull/16/files#diff-dae71ea775e4866963dd6d233ae0acd9f2ed19cdaed18a565323ca6af48ac35dR62
While checking the operator image, I noticed that - `operator` tag is `4.7.0-514-gba6cde5b55-fast` - `main` tag is `4.7.x-514-gba6cde5b55-fast` - MainVersion embedded in `operator` binary is `4.7.0-514-gba6cde5b55-fast` The last thing is wrong. MainVersion must match the `main` tag, i.e. have `.x` instead of `.0`. It does not matter a whole lot in the grand scheme of things because the specific images will come from the bundle CSV in case of bundle-based deployments, but I want to fix it nevertheless.
2a3fbce to
17a04f1
Compare
|
/retest operator-on-push |
|
/retest main-on-push |
|
/retest operator-bundle-on-push |
Testing round
|
|
/retest operator-on-push |
|
@msugakov: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
There's a dirty check in the task which determines image tags. Introduced in https://github.com/stackrox/konflux-tasks/pull/16/files#diff-dae71ea775e4866963dd6d233ae0acd9f2ed19cdaed18a565323ca6af48ac35dR62.
Version suffixes also aren't needed because that's also handled in image tag tasks.
Commits in this PR have explanations, in case you're wondering why things are done this way.
Part of the changes here are extracted from #13422 (for historical context).
User-facing documentation
Testing and quality
Automated testing
No change.
How I validated my change
Checklist template for myself
See comment(s) below with the results of checking.