Make admin secrets optional (bsc#1262409) - #769
Merged
mcalmer merged 1 commit intoApr 20, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes certain Podman secrets (admin credentials and DB credentials) optional when generating the Uyuni server systemd unit, enabling upgrades from older installations that don’t have those secrets present.
Changes:
- Make DB and report DB credential
--secretarguments conditional in the systemd service template. - Only inject admin/DB/reportDB secret names into the template data when the corresponding secrets exist.
- Add a unit test case covering template rendering when optional secrets are not provided.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| uyuni-tools.changes.oholecek.optional_admin_secret | Adds a changelog entry for the upgrade behavior change. |
| mgradm/shared/templates/templates_test.go | Adds a test covering service template output without optional secrets. |
| mgradm/shared/templates/serviceTemplate.go | Makes DB/reportDB secrets conditional in the generated systemd unit. |
| mgradm/shared/podman/podman.go | Populates template secret fields only when secrets exist to avoid upgrade failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Admin user secret is needed only for first initialization. Make them optional so upgrade works.
aaannz
force-pushed
the
fix_missing_secrets_on_upgrade
branch
from
April 20, 2026 14:17
c0d9c0e to
db9862d
Compare
|
cbosdo
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What does this PR change?
Admin and some other secrets are used only during the installation. Make them optional so upgrade from non-5.2 installs works.
Codespace
Check if you already have a running container clicking on
Test coverage
Unit tests were added
DONE
Links
Issue(s): #
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test(see below)Before you merge
Check How to branch and merge properly!