mirror of
https://github.com/docker/cli.git
synced 2026-01-26 15:41:42 +03:00
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: 30e3620eaea88cf33fd7deb8c88359469c27b3f7 Component: engine
23 lines
510 B
Go
23 lines
510 B
Go
package credentials
|
|
|
|
import (
|
|
"os/exec"
|
|
|
|
"github.com/docker/docker/cliconfig/configfile"
|
|
)
|
|
|
|
// DetectDefaultStore sets the default credentials store
|
|
// if the host includes the default store helper program.
|
|
func DetectDefaultStore(c *configfile.ConfigFile) {
|
|
if c.CredentialsStore != "" {
|
|
// user defined
|
|
return
|
|
}
|
|
|
|
if defaultCredentialsStore != "" {
|
|
if _, err := exec.LookPath(remoteCredentialsPrefix + defaultCredentialsStore); err == nil {
|
|
c.CredentialsStore = defaultCredentialsStore
|
|
}
|
|
}
|
|
}
|