Use the Windows Credentials Manager when the helper is installed in the path. Signed-off-by: David Calavera <david.calavera@gmail.com> Upstream-commit: 056c27d895e6e0c416d8d4253e99f4b211a1fb4f Component: engine
23 lines
498 B
Go
23 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
|
|
}
|
|
}
|
|
}
|