Skip to content

Commit

Permalink
pkg/authn: return Anonymous on podman auth.json errors (#1248)
Browse files Browse the repository at this point in the history
This is similar to what happens when the package looks for Docker's
config.json, it ignores any error (not found, permissions denied, …)
and pass on.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
  • Loading branch information
vdemeester authored Jan 20, 2022
1 parent 890d5b3 commit d22850a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/authn/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ func (dk *defaultKeychain) Resolve(target Resource) (Authenticator, error) {
}
} else {
f, err := os.Open(filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "containers/auth.json"))
if os.IsNotExist(err) {
if err != nil {
return Anonymous, nil
} else if err != nil {
return nil, err
}
defer f.Close()
cf, err = config.LoadFromReader(f)
Expand Down

0 comments on commit d22850a

Please sign in to comment.