Merge pull request #2544 from qoo2p5/master

Fixes #2543: bug with panic when DOCKER_CLI_EXPERIMENTAL is incorrect
This commit is contained in:
Tibor Vass 2020-05-28 12:18:00 -07:00 committed by GitHub
commit 263bb539f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -144,7 +144,9 @@ func (cli *DockerCli) ServerInfo() ServerInfo {
// ClientInfo returns the client details for the cli // ClientInfo returns the client details for the cli
func (cli *DockerCli) ClientInfo() ClientInfo { func (cli *DockerCli) ClientInfo() ClientInfo {
if cli.clientInfo == nil { if cli.clientInfo == nil {
_ = cli.loadClientInfo() if err := cli.loadClientInfo(); err != nil {
panic(err)
}
} }
return *cli.clientInfo return *cli.clientInfo
} }
@ -273,6 +275,11 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
} }
} }
cli.initializeFromClient() cli.initializeFromClient()
if err := cli.loadClientInfo(); err != nil {
return err
}
return nil return nil
} }