-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
entrypoint image lookup: change auth order #620
entrypoint image lookup: change auth order #620
Conversation
mkc := authn.NewMultiKeychain(kc, google.Keychain) | ||
// this will first try to anonymous | ||
// the fall back to authenticate using the k8schain, | ||
// then fall back to the google keychain |
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.
Can you add a comment stating that this will (currently) fail if gcloud isn't available?
type anonymousKeychain struct{} | ||
|
||
func (a *anonymousKeychain) Resolve(_ name.Registry) (authn.Authenticator, error) { | ||
return &anonymous{}, nil |
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.
Does this return your own anonymous implementation since NewMultiKeychain
has special logic to detect authn.Anonymous
? (ref)
If so, can you document that, so I don't try to make this return authn.Anonymous
in a future change?
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.
It returns our own anonymous implement because NewMultiKeychain
has a special logic to detect authn.Anonymous
(and will skip it until the end). Good point, I'll had a comment about that too 👍
The google.Keychain will fail hard in case of `gcloud` command missing (which can be the case in minikube and other kubernetes cluster). This means it will fail before trying to contact the registry anonymously — even if the images are publically available. This add an ad-hoc anonymous keychain, and set it as the first keychaien to check. That way, it will first try to get images config anonymously and then try other authentications. Signed-off-by: Vincent Demeester <[email protected]>
2aaeb30
to
968814d
Compare
/hold |
38a1e31
to
ce09b2e
Compare
ce09b2e
to
b7917e1
Compare
1a41bd9
to
bc934d1
Compare
Signed-off-by: Vincent Demeester <[email protected]>
bc934d1
to
e16f68b
Compare
/test pull-tekton-pipeline-integration-tests |
/hold cancel |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ImJasonH, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…image remove gcs-fetcher image as removed in upstream
Changes
The google.Keychain will fail hard in case of
gcloud
commandmissing (which can be the case in minikube and other kubernetes
cluster). This means it will fail before trying to contact the
registry anonymously — even if the images are publically available.
This add an ad-hoc anonymous keychain, and set it as the first
keychaien to check. That way, it will first try to get images config
anonymously and then try other authentications.
Signed-off-by: Vincent Demeester [email protected]
This could be removed if google/go-containerregistry#405 gets merged, but I also think pipeline should try anonymously before the rest.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
[ ] Includes tests (if functionality changed/added)[ ] Includes docs (if user facing)See the contribution guide
for more details.