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

Attempt 2: Check for Podman's auth in DefaultKeychain #1185

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

imjasonh
Copy link
Collaborator

This is a second attempt after #1181, reverted in #1184 due to #1183

The bug seems to be that if $DOCKER_CONFIG was unset, we would never look for $HOME/.docker/config.json, which config.Load does.

The order should be:

  1. look for $HOME/.docker/config.json <-- missing before; very common
  2. look for $DOCKER_CONFIG/config.json
  3. look for $XDG_RUNTIME_DIR/containers/auth.json (Podman auth)

This is now reflected in this PR, with a unit test that builds up each option from 3->1 and checks that the correct auth config is used.

I'm open to more ideas about how to test this better, in case there are more edge cases I'm still not considering.

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2021

Codecov Report

Merging #1185 (5f6e919) into main (bce5496) will decrease coverage by 0.02%.
The diff coverage is 74.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1185      +/-   ##
==========================================
- Coverage   75.24%   75.21%   -0.03%     
==========================================
  Files         108      108              
  Lines        7856     7887      +31     
==========================================
+ Hits         5911     5932      +21     
- Misses       1379     1385       +6     
- Partials      566      570       +4     
Impacted Files Coverage Δ
pkg/authn/keychain.go 78.94% <74.28%> (-21.06%) ⬇️
pkg/v1/remote/multi_write.go 63.90% <0.00%> (+0.97%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bce5496...5f6e919. Read the comment docs.

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

3 participants