-
Couldn't load subscription status.
- Fork 36
update use of auth.json credentials for import, add test of existing image import behavior
#726
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
update use of auth.json credentials for import, add test of existing image import behavior
#726
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
|
This is ready to review now. |
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
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'm bugged by the fact that 'if [[ -n $undefined_var ]]' is not causing any issues in bash :) decades of "it"-level fears...
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.