Fix version comparison when negotiating the the API version
Signed-off-by: Yu-Ju Hong <yjhong@google.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+2
-2
@@ -248,8 +248,8 @@ func (cli *Client) NegotiateAPIVersionPing(p types.Ping) {
|
||||
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) {
|
||||
// if server version is lower than the client version, downgrade
|
||||
if versions.LessThan(p.APIVersion, cli.version) {
|
||||
cli.version = p.APIVersion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user