Repository navigation
Conversation
Allow updating auth registry credentials on a running container by overwriting the htpasswd file via exec. Assisted-by: AI Signed-off-by: Alice Frosi <afrosi@redhat.com>
Extend the auth registry integration test to verify password rotation with both user and password change, and add a CreateAuthPod helper to reduce duplication. Assisted-by: AI Signed-off-by: Alice Frosi <afrosi@redhat.com>
Johan-Liebert1
requested changes
Oct 7, 2026
| } | ||
|
|
||
| cmd.Flags().StringVar(®istryUser, "registry-user", "", "Username for the authenticated registry") | ||
| cmd.Flags().StringVar(®istryPassword, "registry-password", "", "Password for the authenticated registry") |
Member
There was a problem hiding this comment.
This will show the password in the terminal right? We should probably use a hidden field for passwords
|
|
||
| escaped := strings.ReplaceAll(htpasswdEntry, "'", "'\\''") | ||
| _, err = m.podman.ContainerExec(ctx, config.AuthRegistryContainerName, []string{ | ||
| "/bin/sh", "-c", fmt.Sprintf("printf '%%s\\n' '%s' > /auth/htpasswd", escaped), |
Member
There was a problem hiding this comment.
we can use backticks in Sprintf which should also help with escaping quotes
|
|
||
| escaped := strings.ReplaceAll(htpasswdEntry, "'", "'\\''") | ||
| _, err = m.podman.ContainerExec(ctx, config.AuthRegistryContainerName, []string{ | ||
| "/bin/sh", "-c", fmt.Sprintf("printf '%%s\\n' '%s' > /auth/htpasswd", escaped), |
Member
There was a problem hiding this comment.
when restart the container entrypoint re-executes this leading to file being overwritten with initial credentials
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.
Add a new command to the registry
update-credentialsto update the user and password authentication for the registry.Fixes: #148