1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-13 16:01:28 +05:30

mac: delete credentials before adding them to avoid already exist error (fixes #37)

Signed-off-by: ebriney <emmanuel.briney@docker.com>
This commit is contained in:
ebriney
2017-02-14 22:50:44 +01:00
parent f72c04f1d8
commit eecc09c974
+4 -1
View File
@@ -10,11 +10,12 @@ package osxkeychain
import "C"
import (
"errors"
"github.com/docker/docker-credential-helpers/credentials"
"net/url"
"strconv"
"strings"
"unsafe"
"github.com/docker/docker-credential-helpers/credentials"
)
// errCredentialsNotFound is the specific error message returned by OS X
@@ -26,6 +27,8 @@ type Osxkeychain struct{}
// Add adds new credentials to the keychain.
func (h Osxkeychain) Add(creds *credentials.Credentials) error {
h.Delete(creds.ServerURL)
s, err := splitServer(creds.ServerURL)
if err != nil {
return err