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:
Yu-Ju Hong
2017-11-29 15:53:01 -08:00
committed by Sebastiaan van Stijn
parent 93c8cd4a54
commit 7da03c8e7c
+2 -2
View File
@@ -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
}
}