Partially revert cf663b526a as it breaks the version negotiation with an older docker engine.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki 2020-05-19 18:37:24 +02:00
parent f729837d44
commit 54f766d240
1 changed files with 1 additions and 4 deletions

View File

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