mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
prevent crash when .dockercfg not readable
This commit is contained in:
parent
4cb57a5438
commit
3c9f9945c9
2 changed files with 5 additions and 2 deletions
|
@ -80,7 +80,7 @@ func LoadConfig(rootPath string) (*ConfigFile, error) {
|
|||
}
|
||||
b, err := ioutil.ReadFile(confFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return &configFile, err
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(b, &configFile.Configs); err != nil {
|
||||
|
|
|
@ -1751,7 +1751,10 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, proto, addr string) *Doc
|
|||
err = out
|
||||
}
|
||||
|
||||
configFile, _ := auth.LoadConfig(os.Getenv("HOME"))
|
||||
configFile, e := auth.LoadConfig(os.Getenv("HOME"))
|
||||
if e != nil {
|
||||
fmt.Fprintf(err, "WARNING: %s\n", e)
|
||||
}
|
||||
return &DockerCli{
|
||||
proto: proto,
|
||||
addr: addr,
|
||||
|
|
Loading…
Reference in a new issue