Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CLI should honor API version header when _ping returns unsuccessful status code #149

Copy link
Copy link
Closed
@aaronlehmann

Description

@aaronlehmann
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.