1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #20796 from calavera/default_windows_creds_helper

Set default credentials store in Windows.
This commit is contained in:
Sebastiaan van Stijn 2016-03-01 11:12:14 +01:00
commit 9c7e1aeeb1
5 changed files with 30 additions and 30 deletions

View file

@ -0,0 +1,22 @@
package credentials
import (
"os/exec"
"github.com/docker/docker/cliconfig"
)
// DetectDefaultStore sets the default credentials store
// if the host includes the default store helper program.
func DetectDefaultStore(c *cliconfig.ConfigFile) {
if c.CredentialsStore != "" {
// user defined
return
}
if defaultCredentialsStore != "" {
if _, err := exec.LookPath(remoteCredentialsPrefix + defaultCredentialsStore); err == nil {
c.CredentialsStore = defaultCredentialsStore
}
}
}

View file

@ -1,22 +1,3 @@
package credentials
import (
"os/exec"
"github.com/docker/docker/cliconfig"
)
const defaultCredentialsStore = "osxkeychain"
// DetectDefaultStore sets the default credentials store
// if the host includes the default store helper program.
func DetectDefaultStore(c *cliconfig.ConfigFile) {
if c.CredentialsStore != "" {
// user defined
return
}
if _, err := exec.LookPath(remoteCredentialsPrefix + c.CredentialsStore); err == nil {
c.CredentialsStore = defaultCredentialsStore
}
}

View file

@ -0,0 +1,5 @@
// +build !windows,!darwin
package credentials
const defaultCredentialsStore = ""

View file

@ -1,11 +0,0 @@
// +build !darwin
package credentials
import "github.com/docker/docker/cliconfig"
// DetectDefaultStore sets the default credentials store
// if the host includes the default store helper program.
// This operation is only supported in Darwin.
func DetectDefaultStore(c *cliconfig.ConfigFile) {
}

View file

@ -0,0 +1,3 @@
package credentials
const defaultCredentialsStore = "wincred"