From 54f766d240f8e8c01bcde6061c877cf6e65e7f3d Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 19 May 2020 18:37:24 +0200 Subject: [PATCH] Partially revert cf663b526a34f3e7911e6e60138138c2023aa844 as it breaks the version negotiation with an older docker engine. Signed-off-by: Silvin Lubecki --- cli/command/cli.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 }