Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit e002ed9

Browse files
qoo2p5Tibor Vass
authored andcommitted
Fix bug with panic when DOCKER_CLI_EXPERIMENTAL environment variable is incorrect
Signed-off-by: Daniil Nikolenko <qoo2p5@gmail.com> (cherry picked from commit cb010db830a60f53ef1685d99612d23fde93bec9) Signed-off-by: Tibor Vass <tibor@docker.com> Upstream-commit: e90b6bcb62e266bc7763a8fb360dd2bd1741bebc Component: cli
1 parent 1721a7c commit e002ed9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • components/cli/cli/command

components/cli/cli/command/cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ func (cli *DockerCli) ServerInfo() ServerInfo {
148148
// ClientInfo returns the client details for the cli
149149
func (cli *DockerCli) ClientInfo() ClientInfo {
150150
if cli.clientInfo == nil {
151-
_ = cli.loadClientInfo()
151+
if err := cli.loadClientInfo(); err != nil {
152+
panic(err)
153+
}
152154
}
153155
return *cli.clientInfo
154156
}
@@ -277,6 +279,11 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
277279
}
278280
}
279281
cli.initializeFromClient()
282+
283+
if err := cli.loadClientInfo(); err != nil {
284+
return err
285+
}
286+
280287
return nil
281288
}
282289

0 commit comments

Comments
 (0)