Skip to content
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

fix: oras-go client should fallback to docker config if no credentials specified #18133

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tonyay163
Copy link

@tonyay163 tonyay163 commented May 8, 2024

I'm using #17279 to authenticate to Google Artifact Registry as a helm registry using workload identity. Unlike #10218, the other solution does not require installing ESO. This works in general since helm template can get creds via the $HOME/.docker/config.json. However, if you need to use targetRevision: * with your application, this ends up using the oras-go client here which is only configured for static credentials.

This change adds a backwards compatible change where if both the username and password is not configured, it will use the oras-go credentials package to get the docker config from the environment and use that to get credentials.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@tonyay163 tonyay163 requested a review from a team as a code owner May 8, 2024 23:44
@tonyay163 tonyay163 changed the title oras-go client should fallback to docker config if no credentials specified fix: oras-go client should fallback to docker config if no credentials specified May 8, 2024
@tonyay163 tonyay163 force-pushed the tauyeung/docker-config-fallback branch from 9177db1 to e8848aa Compare May 8, 2024 23:45
Signed-off-by: Tony Au-Yeung <[email protected]>
@tonyay163 tonyay163 force-pushed the tauyeung/docker-config-fallback branch from 33eae18 to 92d9ffb Compare May 8, 2024 23:49
Signed-off-by: Tony Au-Yeung <[email protected]>
@tonyay163
Copy link
Author

I tested this ETE and it seems to work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant