diff --git a/cli/command/cli.go b/cli/command/cli.go index 37a45494e6..2081c8f46b 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -9,7 +9,6 @@ import ( "runtime" "strconv" "strings" - "sync" "time" "github.com/docker/cli/cli/config" @@ -136,12 +135,9 @@ func (cli *DockerCli) loadConfigFile() { cli.configFile = cliconfig.LoadDefaultConfigFile(cli.err) } -var fetchServerInfo sync.Once - // ServerInfo returns the server version details for the host this client is // connected to func (cli *DockerCli) ServerInfo() ServerInfo { - fetchServerInfo.Do(cli.initializeFromClient) return cli.serverInfo } @@ -276,6 +272,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize return err } } + cli.initializeFromClient() return nil }