update use of auth.json credentials for import, add test of existing image import behavior#726
Merged
hallyn merged 4 commits intoproject-stacker:mainfrom Sep 22, 2025
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b506692 to
2b69ac7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
c0954ec to
8b99c1f
Compare
import, add test of existing image import behavior
ensure we get the new skopeo into hack/tools/bin and then put that at the front of PATH Signed-off-by: Michael McCracken <mikmccra@cisco.com>
This is a test to check existing behavior. Internally, without stacker needing to pass creds in the opts, containers/image uses GetCredentials() to look in auth.json for creds for calls to copy.Image(). this adds a test to cover this case using a zot configured to require auth. also generates certs for the zot in the test. some other cleanup in tests Signed-off-by: Michael McCracken <mikmccra@cisco.com>
To support different credentials for different paths on a host (e.g. an artifactory server with multiple repositories), we need stacker to send the full path to GetCredentials. GetCredentials searches for the full path, then iterates over subpaths by removing one path component at a time, so the creds from longest matching subpath are returned. Updates the import-http-auth test to show this behavior. Signed-off-by: Michael McCracken <mikmccra@cisco.com>
8b99c1f to
7b0c850
Compare
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
d905c09 to
e3c066a
Compare
Contributor
Author
|
This is ready to review now. |
mikemccracken
commented
Sep 19, 2025
hallyn
approved these changes
Sep 22, 2025
Contributor
hallyn
left a comment
There was a problem hiding this comment.
I'm bugged by the fact that 'if [[ -n $undefined_var ]]' is not causing any issues in bash :) decades of "it"-level fears...
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.
containers/image
copy.Image()already usesGetCredentials()to look inauth.jsonfor base image imports.this adds a test to cover this case using a zot configured to require auth. also generates certs for the zot in the test.
It also updates the previous auth code for
importsection imports, so that we now pass the entire path of an import toGetCredentials(), which lets us use different creds for different subpaths on a host.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.