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

Commit ddc55e5

Browse files
Partially revert cf663b526a34f3e7911e6e60138138c2023aa844 as it breaks the version negotiation with an older docker engine.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com> (cherry picked from commit 54f766d240f8e8c01bcde6061c877cf6e65e7f3d) Upstream-commit: 2d1476c6f006932beacac0a7769e458150316345 Component: cli
1 parent de971df commit ddc55e5

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • components/cli/cli/command

components/cli/cli/command/cli.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"runtime"
1010
"strconv"
1111
"strings"
12-
"sync"
1312
"time"
1413

1514
"github.com/docker/cli/cli/config"
@@ -140,12 +139,9 @@ func (cli *DockerCli) loadConfigFile() {
140139
cli.configFile = cliconfig.LoadDefaultConfigFile(cli.err)
141140
}
142141

143-
var fetchServerInfo sync.Once
144-
145142
// ServerInfo returns the server version details for the host this client is
146143
// connected to
147144
func (cli *DockerCli) ServerInfo() ServerInfo {
148-
fetchServerInfo.Do(cli.initializeFromClient)
149145
return cli.serverInfo
150146
}
151147

@@ -280,6 +276,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
280276
return err
281277
}
282278
}
279+
cli.initializeFromClient()
283280
return nil
284281
}
285282

0 commit comments

Comments
 (0)