Merge pull request #20796 from calavera/default_windows_creds_helper

Set default credentials store in Windows.
Upstream-commit: 9c7e1aeeb1b9a14691dda831da4674b76852a24f
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-03-01 11:12:14 +01:00
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"