When _ping returns a non-200 HTTP status code, the CLI defaults to the latest API version. This can result in errors like:
your client is too new (API version 1.27). The newest supported API version is 1.26.0
...when the CLI moves on to performing the actual operation.
The CLI should still honor the version header, so _ping returning a bad status code doesn't prevent the CLI from working at all. Right now the client's Ping method just returns an error, but it should still return the version information in this case. Maybe the HTTP status code should be moved to a field on types.Ping instead of triggering an error.
I ran into this issue running the CLI against Docker Datacenter. Its _ping endpoint was returning a 500 status code because the cluster was considered unhealthy. But this caused the CLI to use a newer API version than was supported, so CLI commands didn't work at all while the cluster was in this state.
When
_pingreturns a non-200 HTTP status code, the CLI defaults to the latest API version. This can result in errors like:...when the CLI moves on to performing the actual operation.
The CLI should still honor the version header, so
_pingreturning a bad status code doesn't prevent the CLI from working at all. Right now the client'sPingmethod just returns an error, but it should still return the version information in this case. Maybe the HTTP status code should be moved to a field ontypes.Pinginstead of triggering an error.I ran into this issue running the CLI against Docker Datacenter. Its
_pingendpoint was returning a 500 status code because the cluster was considered unhealthy. But this caused the CLI to use a newer API version than was supported, so CLI commands didn't work at all while the cluster was in this state.