-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Steps to reproduce the issue:
We are developer an ACR credential helper. The issue was discovered during our test on os X.
We ran
az acr login -name <our registry>az acr logout
The log out succeeded and the credentials were removed from osxkeychain. However, We do see the following output
WARNING: could not erase credentials: error erasing credentials - err: exit status 1, out: 'The specified item could not be found int the keychain'
After looking into the docker code. We realized this is not an ACR specific issue. This issue should repro on any non-default registry if osxkeychain was used in cred store .
Problem with the code:
https://github.com/docker/cli/blob/master/cli/command/registry/logout.go#L42-L53
In the case where hostnameAddress and serverAddress are the same, we would have duplicated entries in regsToTry. Assuming you can find serverAddress in the config file, Erase() will be called twice for this serverAddress. Cred stores such as file store or WinCred does not complain if you try to remove an entry that does not exist, but osxkeychain would.