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)
| 164 | // when updating the configuration file, to prevent discarding a (malformed) |
| 165 | // configuration file. |
| 166 | func 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 | } |
searching dependent graphs…