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

Include target resource in credential warning #882

Merged
merged 1 commit into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/v1/google/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func WithAuthFromKeychain(keys authn.Keychain) ListerOption {
return err
}
if auth == authn.Anonymous {
logs.Warn.Println("No matching credentials were found, falling back on anonymous")
logs.Warn.Printf("No matching credentials were found for %q, falling back on anonymous", l.repo.Registry)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a newline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, from https://golang.org/pkg/log/:

Every log message is output on a separate line: if the message being printed does not end in a newline, the logger will add one.

}
l.auth = auth
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func makeOptions(target authn.Resource, opts ...Option) (*options, error) {
return nil, err
}
if auth == authn.Anonymous {
logs.Warn.Println("No matching credentials were found, falling back on anonymous")
logs.Warn.Printf("No matching credentials were found for %q, falling back on anonymous", target)
}
o.auth = auth
}
Expand Down