mirror of https://github.com/docker/cli.git
config: fix error message using incorrect filename
Before: echo 'invalid-json' > ~/.dockercfg docker pull hello-world WARNING: Error loading config file: /root/.docker/config.json: Invalid Auth config file After: echo 'invalid-json' > ~/.dockercfg docker pull hello-world WARNING: Error loading config file: /root/.dockercfg: Invalid Auth config file Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
af2c31c4a7
commit
494f30a1a5
|
@ -117,11 +117,11 @@ func Load(configDir string) (*configfile.ConfigFile, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return configFile, errors.Wrap(err, oldConfigfile)
|
return configFile, errors.Wrap(err, oldConfigfile)
|
||||||
}
|
}
|
||||||
confFile := filepath.Join(homedir, oldConfigfile)
|
filename = filepath.Join(homedir, oldConfigfile)
|
||||||
if _, err := os.Stat(confFile); err != nil {
|
if _, err := os.Stat(filename); err != nil {
|
||||||
return configFile, nil // missing file is not an error
|
return configFile, nil // missing file is not an error
|
||||||
}
|
}
|
||||||
file, err := os.Open(confFile)
|
file, err := os.Open(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return configFile, errors.Wrap(err, filename)
|
return configFile, errors.Wrap(err, filename)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue