Skip to content

Conversation

mountkin
Copy link
Contributor

@mountkin mountkin commented May 7, 2016

- What I did
According to https://docs.docker.com/engine/deprecated/#hostconfig-at-api-container-start passing HostConfig to the container start API will be removed in 1.12.
This PR removed the deprecated feature and the related test cases.
- How I did it
Remove the related code.
Raise an error when the user tries to pass HostConfig when calling POST /containers/xxx/start API.
- How to verify it
Call the container start API with HostConfig and check the error message.
- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Shijiang Wei mountkin@gmail.com

@runcom
Copy link
Member

runcom commented May 7, 2016

LGTM :)

@thaJeztah
Copy link
Member

I don't know how we usually handled API deprecations like this. Looking at this, I wonder if we actually can remove this, without disabling API versions 1.something and older.

The reason for a versioned API is of course that it doesn't change, so wondering if we should disable older API versions altogether. Open to suggestions, just thinking out loud here

@mountkin mountkin force-pushed the rm-deprecated-feature branch from 0aa61ad to 4577d88 Compare May 7, 2016 14:58
@mountkin
Copy link
Contributor Author

mountkin commented May 7, 2016

@thaJeztah Could you provide some information or previous discussion about deprecating this feature?
Indeed removing this code might break some old apps. I've no idea whether we should keep the current behavior for old API users. Suggestions are welcomed.
Thanks 😃

@mountkin
Copy link
Contributor Author

mountkin commented May 7, 2016

Found #17799 and #14777

@thaJeztah
Copy link
Member

@mountkin yes, I'm trying to think of other examples, i.e., have we done this before? Usually, we keep the old behavior around for older API versions, so perhaps we should change it to be an error for API version 1.24 and above, but keep the old behavior for older versions.

ping @cpuguy83 @calavera wdyt?

@cpuguy83
Copy link
Member

cpuguy83 commented May 9, 2016

I don't think we can just remove it, which means we'll have to still handle older API versions, which means the case must still be handled (by switching on API versions) which will probably make the code more complex and not less, sadly.

@LK4D4
Copy link
Contributor

LK4D4 commented May 9, 2016

I agree with @cpuguy83

@thaJeztah
Copy link
Member

Alright, so we should keep this code around (unfortunately), and make it an error if it's used on API 1.24 or above (instead of just a warning).

@mountkin can you update the PR to do that? Sorry for that, I think we all wished we could cleanup this code

@mountkin mountkin force-pushed the rm-deprecated-feature branch from 4577d88 to 98fce68 Compare May 10, 2016 13:17
@mountkin
Copy link
Contributor Author

I think we can add an HTTP header (for example: Deprecated-Features-Used: 17799, 17799 is the github issue where the deprecation was proposed) to all the HTTP requests to the official registry.
Then the Docker team can analyse the docker hub HTTP log to determine whether the deprecated feature can be completely removed.
We're already sending kernel version and os version information via the User-Agent header.

@mountkin
Copy link
Contributor Author

Code updated.
I also moved the related API tests to a separate file integration-cli/docker_deprecated_api_v124_test.go and renamed all the test cases to TestDeprecatedXXX so that we can run TESTFLAGS='-check.f DockerSuite.TestDeprecated*' make test-integration-cli to test the deprecated APIs.

@mountkin mountkin force-pushed the rm-deprecated-feature branch 2 times, most recently from cb96ad2 to 25067e7 Compare May 10, 2016 15:37
@mountkin mountkin force-pushed the rm-deprecated-feature branch 3 times, most recently from dfaecfd to ebe464e Compare May 20, 2016 11:53
@thaJeztah
Copy link
Member

ping @LK4D4 @cpuguy83 PTAL!

@icecrime
Copy link
Contributor

Ping @runcom and @calavera too :-)

@calavera
Copy link
Contributor

calavera commented Jun 1, 2016

🤘 LGTM

@calavera
Copy link
Contributor

calavera commented Jun 1, 2016

It looks like WinTP5 complains in those new tests, btw.

@mountkin mountkin force-pushed the rm-deprecated-feature branch from ebe464e to 9c53f87 Compare June 1, 2016 04:22
@mountkin
Copy link
Contributor Author

mountkin commented Jun 1, 2016

All tests passed. PTAL again. Thanks

@vdemeester
Copy link
Member

LGTM 👍

@vdemeester
Copy link
Member

Putting it to docs-review, @thaJeztah 😝

@thaJeztah
Copy link
Member

I think we should add a mention in the API changes;
https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api.md#v124-api-changes

something like;

* `POST /containers/(id or name)/start` no longer accepts a `HostConfig`

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
@mountkin mountkin force-pushed the rm-deprecated-feature branch from 9c53f87 to 0a8386c Compare June 1, 2016 14:25
@mountkin
Copy link
Contributor Author

mountkin commented Jun 1, 2016

doc updated

@thaJeztah
Copy link
Member

Thanks! LGTM

ping @vdemeester ptal

@vdemeester
Copy link
Member

LGTM 🐮

@vdemeester vdemeester merged commit 4b86651 into moby:master Jun 1, 2016
yongtang added a commit to yongtang/docker that referenced this pull request Jun 3, 2016
This fix tries to address several issues in deprecated.md:
1. For deprecated and removal versions, some include link reference
to the release tag but some does not point to the release tag. This
fix adds the missing links as long as the version is <= 1.12.
2. Technically, 1.12 is not released yet so the link to 1.12 does
not exist yet. However, at the time 1.12 is released this
deprecated.md doc should have been part of the release as well.
There is a circular dependency. This fix adds 1.12 for now.
3. `HostConfig at API container start` has already been removed
by moby#22570 so this fix changes `Target For Removal In Release: v1.12`
to `Removed In Release: v1.12`.
4. `Docker search 'automated' and 'stars' options` has not been removed
yet so this fix changes `Removed In Release: v1.14` to
`Target For Removal In Release: v1.14`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
@mountkin mountkin deleted the rm-deprecated-feature branch June 6, 2016 10:26
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.

9 participants