-
Notifications
You must be signed in to change notification settings - Fork 79
Support setting the releasever dnf variable through the Blueprint customization [HMS-9368]
#1896
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
The linter and integration tests aren't very happy about the first commit. So this should be fine once the blueprint PR is merged and released. |
7c02418 to
8cd6465
Compare
8cd6465 to
a551234
Compare
a551234 to
8178a2f
Compare
|
Clicked the rebase button. Cleared that Snyk failure. |
thozza
left a comment
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.
I believe there's a bug in the ImageConfig code, and the unit tests could be enhanced to detect the issue.
Other than that, everything looks good. 👍
70c7ef3 to
7a87380
Compare
thozza
left a comment
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.
LGTM, thanks for the fixes!
|
Manifest checksums have changed. |
|
Rebasing and fixing up. |
7a87380 to
19c92c8
Compare
tag v1.14.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 1.14.0 ---------------- - customization: add firstboot (osbuild/blueprint#23) - Author: Lukáš Zapletal, Reviewers: Achilleas Koutsou, Katarína Sieklová — Somewhere on the Internet, 2025-09-29 --- tag v1.15.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 1.15.0 ---------------- - blueprint: new customization: dnf (osbuild/blueprint#34) - Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Michael Vogt, Tomáš Hozza — Somewhere on the Internet, 2025-09-29 ---
The dnf variable name is `releasever` and it is more consistent with other user-facing use cases where it is treated as a single word. So let's treat it internally as a single word as well. This matches the new blueprint customization. Similarly, rename the struct field from SetReleaseVerVar to SetReleaseverVar to match.
Minor fix for the grammar of an internal error.
We currently have no use case for specifying multiple sets of configs for dnf_config. More importantly, there's no reason to have multiple org.osbuild.dnf.config stages in the same pipeline. The stage can handle multiple variables and a single set of global dnf config options, so a single stage should be able to cover all use cases. Make the dnf_config.options.config option in the image definitions a single item instead of an array and only support generating a single dnf config stage.
The dnf config options getter has a fail state when there is a conflict between different options that shouldn't be used together. Return an error from the function instead of panicking.
19c92c8 to
db8708c
Compare
thozza
left a comment
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.
LGTM, thanks
Previously this was not supported because the dnf_config.options.variables can set a releasever which would conflict with the variable set by enabling dnf_config.set_releasever_var. However, it's trivial to check for a conflicting variable of the same name and make that the only error condition. The tests have been rewritten to test all combinations.
Add a helper function that either updates or appends new variables to the dnf config stage options.
When the blueprint dnf config customization enables the new set_releasever option, add it to the dnf.config variables stage option.
Enable the new customizations on all RHEL image types where it makes
sense. This includes any image type that supports writing files to the
OS tree, since the new option creates a file in /etc/{dnf,yum}/vars.
db8708c to
18d2fdb
Compare
This PR enables the new customizations (see osbuild/blueprint#34) on all RHEL image types where it makes sense. This includes any image type that supports writing files to the OS tree, since the new option creates a file in
/etc/{dnf,yum}/vars.Notes (and request for comments):
org.osbuild.dnf.configstage, because I think it's unnecessary.pkg/customizations/dnf/) and the blueprint only affects one option from the whole stage.DNFStageOptions.UpdateVar()turned out, but the nil case also makes it a bit awkward.Also related: HMS-9335