Skip to content
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/"
}
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