You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a machine without credentials store, after docker login docker.io succeeds, notation login with the same credential should also succeed with a warning.
However, it fails to detect the existing credential and throws an error:
// if we fail to get the saved credential, log a warning
// but do not throw the GET error, as the error could be
// confusing to users
logger:=log.GetLogger(ctx)
logger.Warnf("Failed to get the existing credentials for %s: %v", registryName, err)
}
returnfmt.Errorf("failed to log in to %s: the credential could not be saved because a credentials store is required to securely store the password. See %s",
registryName, urlDocHowToAuthenticate)
}
where credsStore.Get() attempts to get the credential for docker.io, while the credential for docker.io is stored in the entry https://index.docker.io/v1/ (expected behavior), hence credsStore.Get("docker.io") returns an empty credential savedCred that does not match the provided credential cred.
A mapping from docker.io to https://index.docker.io/v1/ is required.
What did you expect to happen?
notation login should be able to detect the existing credentials for docker.io
What is the areas you experience the issue in?
Notation CLI
What is not working as expected?
On a machine without credentials store, after
docker login docker.io
succeeds,notation login
with the same credential should also succeed with a warning.However, it fails to detect the existing credential and throws an error:
The bug is at here:
notation/cmd/notation/login.go
Lines 118 to 128 in ebfb9ef
where
credsStore.Get()
attempts to get the credential fordocker.io
, while the credential fordocker.io
is stored in the entryhttps://index.docker.io/v1/
(expected behavior), hencecredsStore.Get("docker.io")
returns an empty credentialsavedCred
that does not match the provided credentialcred
.A mapping from
docker.io
tohttps://index.docker.io/v1/
is required.What did you expect to happen?
notation login
should be able to detect the existing credentials fordocker.io
Expected output:
How can we reproduce it?
On a machine without credentials store,
Describe your environment
Windows 11/powershell
What is the version of your Notation CLI or Notation Library?
Version: 1.0.0-rc.7
Go version: go1.20.4
Git commit: ebfb9ef
The text was updated successfully, but these errors were encountered: