mirror of https://github.com/docker/cli.git
fix build issue with updated moby
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
4adf701567
commit
ae8d049f9e
|
@ -15,7 +15,6 @@ import (
|
||||||
dopts "github.com/docker/cli/opts"
|
dopts "github.com/docker/cli/opts"
|
||||||
"github.com/docker/docker/api"
|
"github.com/docker/docker/api"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/versions"
|
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/docker/go-connections/sockets"
|
"github.com/docker/go-connections/sockets"
|
||||||
"github.com/docker/go-connections/tlsconfig"
|
"github.com/docker/go-connections/tlsconfig"
|
||||||
|
@ -193,15 +192,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error {
|
||||||
OSType: ping.OSType,
|
OSType: ping.OSType,
|
||||||
}
|
}
|
||||||
|
|
||||||
// since the new header was added in 1.25, assume server is 1.24 if header is not present.
|
cli.client.NegotiateAPIVersionPing(ping)
|
||||||
if ping.APIVersion == "" {
|
|
||||||
ping.APIVersion = "1.24"
|
|
||||||
}
|
|
||||||
|
|
||||||
// if server version is lower than the current cli, downgrade
|
|
||||||
if versions.LessThan(ping.APIVersion, cli.client.ClientVersion()) {
|
|
||||||
cli.client.UpdateClientVersion(ping.APIVersion)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Default to true if we fail to connect to daemon
|
// Default to true if we fail to connect to daemon
|
||||||
cli.server = ServerInfo{HasExperimental: true}
|
cli.server = ServerInfo{HasExperimental: true}
|
||||||
|
|
Loading…
Reference in New Issue