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: fix the issue with getting credentials for docker.io #703

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/notation/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ func runLogin(ctx context.Context, opts *loginOpts) error {
// ErrPlaintextPutDisabled returned by Login() indicates that the
// credential is validated but is not saved because there is no native
// credentials store available
if savedCred, err := credsStore.Get(ctx, registryName); err != nil || savedCred != cred {
credKeyName := registryName
if registryName == "docker.io" {
// it's as expected that credentials for "docker.io" are stored
// under the key "https://index.docker.io/v1/"
credKeyName = "https://index.docker.io/v1/"
Wwwsylvia marked this conversation as resolved.
Show resolved Hide resolved
}
if savedCred, err := credsStore.Get(ctx, credKeyName); err != nil || savedCred != cred {
if err != nil {
// if we fail to get the saved credential, log a warning
// but do not throw the GET error, as the error could be
Expand Down
Loading