|
1 | 1 | package command |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "fmt" |
5 | 4 | "io" |
6 | 5 | "net/http" |
7 | 6 | "os" |
@@ -157,7 +156,7 @@ func getConfiguredCredentialStore(c *configfile.ConfigFile, serverAddress string |
157 | 156 | // Initialize the dockerCli runs initialization that must happen after command |
158 | 157 | // line flags are parsed. |
159 | 158 | func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error { |
160 | | - cli.configFile = LoadDefaultConfigFile(cli.err) |
| 159 | + cli.configFile = cliconfig.LoadDefaultConfigFile(cli.err) |
161 | 160 |
|
162 | 161 | var err error |
163 | 162 | cli.client, err = NewAPIClientFromFlags(opts.Common, cli.configFile) |
@@ -219,19 +218,6 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer) *DockerCli { |
219 | 218 | return &DockerCli{in: NewInStream(in), out: NewOutStream(out), err: err} |
220 | 219 | } |
221 | 220 |
|
222 | | -// LoadDefaultConfigFile attempts to load the default config file and returns |
223 | | -// an initialized ConfigFile struct if none is found. |
224 | | -func LoadDefaultConfigFile(err io.Writer) *configfile.ConfigFile { |
225 | | - configFile, e := cliconfig.Load(cliconfig.Dir()) |
226 | | - if e != nil { |
227 | | - fmt.Fprintf(err, "WARNING: Error loading config file:%v\n", e) |
228 | | - } |
229 | | - if !configFile.ContainsAuth() { |
230 | | - credentials.DetectDefaultStore(configFile) |
231 | | - } |
232 | | - return configFile |
233 | | -} |
234 | | - |
235 | 221 | // NewAPIClientFromFlags creates a new APIClient from command line flags |
236 | 222 | func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) { |
237 | 223 | host, err := getServerHost(opts.Hosts, opts.TLSOptions) |
|
0 commit comments