mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #33888 from thaJeztah/enable-version-negotiation
Always perform version-negotiation
This commit is contained in:
commit
75a034621d
1 changed files with 7 additions and 2 deletions
|
@ -260,8 +260,13 @@ func (cli *Client) NegotiateAPIVersionPing(p types.Ping) {
|
|||
p.APIVersion = "1.24"
|
||||
}
|
||||
|
||||
// if server version is lower than the current cli, downgrade
|
||||
if versions.LessThan(p.APIVersion, cli.ClientVersion()) {
|
||||
// if the client is not initialized with a version, start with the latest supported version
|
||||
if cli.version == "" {
|
||||
cli.version = api.DefaultVersion
|
||||
}
|
||||
|
||||
// if server version is lower than the maximum version supported by the Client, downgrade
|
||||
if versions.LessThan(p.APIVersion, api.DefaultVersion) {
|
||||
cli.version = p.APIVersion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue