MCPcopy Index your code
hub / github.com/docker/cli / LoadDefaultConfigFile

Function LoadDefaultConfigFile

cli/config/config.go:166–176  ·  view source on GitHub ↗

LoadDefaultConfigFile attempts to load the default config file and returns a reference to the ConfigFile struct. If none is found or when failing to load the configuration file, it initializes a default ConfigFile struct. If no credentials-store is set in the configuration file, it attempts to disco

(stderr io.Writer)

Source from the content-addressed store, hash-verified

164// when updating the configuration file, to prevent discarding a (malformed)
165// configuration file.
166func LoadDefaultConfigFile(stderr io.Writer) *configfile.ConfigFile {
167 configFile, err := load(Dir())
168 if err != nil {
169 // FIXME(thaJeztah): we should not proceed here to prevent overwriting existing (but malformed) config files; see https://github.com/docker/cli/issues/5075
170 _, _ = fmt.Fprintln(stderr, "WARNING: Error", err)
171 }
172 if !configFile.ContainsAuth() {
173 configFile.CredentialsStore = credentials.DetectDefaultStore(configFile.CredentialsStore)
174 }
175 return configFile
176}

Callers 1

Calls 3

loadFunction · 0.85
DirFunction · 0.85
ContainsAuthMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…