mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Commite6907243afapplied a fix for situations where the client was configured with API-version negotiation, but did not yet negotiate a version. However, the checkVersion() function that was implemented copied the semantics of cli.NegotiateAPIVersion, which ignored connection failures with the assumption that connection errors would still surface further down. However, when using the result of a failed negotiation for NewVersionError, an API version mismatch error would be produced, masking the actual connection error. This patch changes the signature of checkVersion to return unexpected errors, including failures to connect to the API. Before this patch: docker -H unix:///no/such/socket.sock secret ls "secret list" requires API version 1.25, but the Docker daemon API version is 1.24 With this patch applied: docker -H unix:///no/such/socket.sock secret ls Cannot connect to the Docker daemon at unix:///no/such/socket.sock. Is the docker daemon running? Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit6aea26b431) Conflicts: client/image_list.go client/image_list_test.go Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2.4 KiB
2.4 KiB