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 4 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 2 times, most recently from 33eae18 to 92d9ffb Compare May 8, 2024 23:49
@tonyay163
Copy link
Author

I tested this ETE and it seems to work well

…cified

Signed-off-by: Tony Au-Yeung <tony@elevenlabs.io>
@tonyay163 tonyay163 force-pushed the tauyeung/docker-config-fallback branch from 620645f to cd9a779 Compare September 23, 2024 16:27
Signed-off-by: Tony Au-Yeung <tony@elevenlabs.io>
Signed-off-by: Tony Au-Yeung <tony@elevenlabs.io>
Signed-off-by: Tony Au-Yeung <tony@elevenlabs.io>
@tonyay163 tonyay163 force-pushed the tauyeung/docker-config-fallback branch from e9febda to 912294f Compare September 23, 2024 17:09
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.81%. Comparing base (864917b) to head (912294f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18133      +/-   ##
==========================================
- Coverage   55.82%   55.81%   -0.02%     
==========================================
  Files         320      320              
  Lines       44431    44436       +5     
==========================================
- Hits        24805    24801       -4     
- Misses      17060    17067       +7     
- Partials     2566     2568       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonyay163
Copy link
Author

tonyay163 commented Sep 23, 2024

@crenshaw-dev / @blakepettersson, sorry to ping directly but it looks like you've contributed to this file recently. I have a pretty simple fix here that I've been running for months now and would like to get it merged. It seems like too small of a fix for an enhancement proposal.

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.

1 participant