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.
Description
This partially reverts cf4822c, which intended to support GCR auth in scenarios where the credential helper wasn't available (e.g., executor-slim), to preserve backward compatibility since the credential helper used to be present.
However, that change seems to have broken auth to GCR from GCB, and presumably other scenarios where there's implicit GCP auth from the environment.
This change uses ggcr's
google.NewEnvAuthenticator
to find implicit GCR auth when none other is available, and when the registry being operated against is GCR or AR.With this change I'm able to run this successfully, which failed before:
(This also works if you build and run the slim image, which does not contain cred helpers 🎉 )
This produced this kaniko-built image:
gcr.io/imjasonh/kaniko-built@sha256:6d8fa0158919992232c6f6eaf882ec88df790709384cc84a1043a087f5e34c8a
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.