Skip to content

Use default keychain to resolve OCI credentials#8274

Merged
bduffany merged 2 commits intomasterfrom
oci-auth-json-2
Feb 3, 2025
Merged

Use default keychain to resolve OCI credentials#8274
bduffany merged 2 commits intomasterfrom
oci-auth-json-2

Conversation

@bduffany
Copy link
Copy Markdown
Member

@bduffany bduffany commented Jan 31, 2025

The ECR credential helper stopped working for one of our on-prem users after they switched from podman to OCI. This is because oci.Resolve() doesn't respect credential helpers.

This PR enables the default keychain in oci.Resolve() (behind a flag) so that credential helpers will work. The default keychain respects commonly used container auth config files, including .docker/config.json and podman's $XDG_RUNTIME_DIR/containers/auth.json.

The customer was specifically trying to use ~/.config/containers/auth.json which doesn't quite work after this PR, but will work if we either patch google/go-containerregistry#2052 or if the customer switches to ~/.docker/config.json instead (that file is generally the least common denominator and is supported by docker, podman, and now oci after this PR).

The plan is to either enable this new flag by default (but make sure it's disabled for our cloud executors), or just enable it in the helm charts.

@bduffany bduffany force-pushed the oci-auth-json-2 branch 2 times, most recently from f8e2edb to 265f52f Compare January 31, 2025 18:41
@bduffany bduffany requested a review from dan-stowell January 31, 2025 18:44
@bduffany bduffany force-pushed the oci-auth-json-2 branch 2 times, most recently from 0829811 to 9957a14 Compare January 31, 2025 21:01
@bduffany bduffany force-pushed the oci-auth-json-2 branch 5 times, most recently from b87612a to e8573d5 Compare February 3, 2025 16:47
@bduffany bduffany merged commit ccd9ef6 into master Feb 3, 2025
@bduffany bduffany deleted the oci-auth-json-2 branch February 3, 2025 17:11
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.

3 participants