1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/cliconfig/credentials/default_store.go
David Calavera 056c27d895 Set default credentials store in Windows.
Use the Windows Credentials Manager when the helper
is installed in the path.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-02-29 17:46:07 -05:00

22 lines
498 B
Go

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
}
}
}