Skip to content

Commit

Permalink
Fix bug with panic when DOCKER_CLI_EXPERIMENTAL environment variable …
Browse files Browse the repository at this point in the history
…is incorrect

Signed-off-by: Daniil Nikolenko <[email protected]>
  • Loading branch information
qoo2p5 committed May 24, 2020
1 parent 590f327 commit cb010db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/command/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ func (cli *DockerCli) ServerInfo() ServerInfo {
// ClientInfo returns the client details for the cli
func (cli *DockerCli) ClientInfo() ClientInfo {
if cli.clientInfo == nil {
_ = cli.loadClientInfo()
if err := cli.loadClientInfo(); err != nil {
panic(err)
}
}
return *cli.clientInfo
}
Expand Down Expand Up @@ -273,6 +275,11 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
}
}
cli.initializeFromClient()

if err := cli.loadClientInfo(); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit cb010db

Please sign in to comment.