Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate API calls without a version #27830

Closed
wants to merge 1 commit into from

Conversation

bfirsh
Copy link
Contributor

@bfirsh bfirsh commented Oct 27, 2016

- What I did

At some point it would be good to make providing a version to API calls mandatory. See #21157 for more information.

However, this will break clients, so we should mark it as deprecated before making the change. See #27801 for the proposed actual change and discussion around deprecation.

- Description for the changelog

Not providing an API version in API calls is now deprecated, and those endpoints will be removed in a future version of Docker. Instead of just requesting, for example, the URL /containers/json, you must now request /v1.25/containers/json.

@vdemeester
Copy link
Member

/cc @thaJeztah @icecrime this should be for 1.13 right ? 👼

@vdemeester vdemeester added this to the 1.13.0 milestone Oct 27, 2016
@@ -1501,7 +1501,7 @@ Search for an image on [Docker Hub](https://hub.docker.com).

**Example request**:

GET /images/search?term=sshd HTTP/1.1
GET /v1.18/images/search?term=sshd HTTP/1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmf, this is gonna be a nightmare to keep the API docs in sync. Well, until we move to Swagger 😄

Copy link
Contributor Author

@bfirsh bfirsh Oct 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with static docs, it isn't too bad – you just have to do a big regex search/replace for each new version.

I did something like this: s/(GET|POST|PATCH|PUT|HEAD|OPTIONS) \/(.+?) HTTP/$1 /v1.25/$2 HTTP/

But yeah... hopefully Swagger will do this for v1.26. ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add that to the release-checklist (there's a section in there that explains bumping the API version)

@thaJeztah
Copy link
Member

It's ok to discuss for 1.13, but no decision was made yet I think.

Should we have a redirect? (does that even work if a socket connection is used?)

@bfirsh
Copy link
Contributor Author

bfirsh commented Oct 27, 2016

We could have a redirect when it is deprecated, but I don't think we should do it now. It will break clients which do not follow redirects. E.g. even curl doesn't do it by default.

Copy link
Contributor

@vieux vieux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/_ping without version is required for #27745

@bfirsh
Copy link
Contributor Author

bfirsh commented Oct 27, 2016

@vieux Perhaps /_ping could be the one exception. That seems so simple that it needn't be versioned.

@thaJeztah
Copy link
Member

@MHBauer
Copy link
Contributor

MHBauer commented Oct 31, 2016

Idea sounds good to me. We're saying that the version is required, to prepare people and get them ready for the actual change made in a couple of versions, per the deprecation policy. There's no code change, just documentation, because we already support versioned access on the API. Thus we only need doc changes for now. As above, we should mention it in the deprecation section.

I am kind of surprised we didn't have the version hardcoded on each of the version specific pages.

See moby#21157 for more details.

In a future version of Docker, providing a version to API calls
will be mandatory. An implementation of this is in moby#27801.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
@bfirsh bfirsh force-pushed the deprecate-no-version-in-api-urls branch from 7d5127b to 6b9e375 Compare October 31, 2016 01:47
@bfirsh
Copy link
Contributor Author

bfirsh commented Oct 31, 2016

@thaJeztah Done! ✨

@vieux Do you think making /_ping the only endpoint allowed without a version a reasonable solution? I suppose it should always remain stable, under the definition that it should return some content with a 200 status code.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vieux
Copy link
Contributor

vieux commented Nov 8, 2016

I'm ok with only ping accessible without version. LGTM

@thaJeztah
Copy link
Member

needs a rebase, so carried in #28208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants