Adjust disallowed CpuShares in /containers/create#13722
Merged
icecrime merged 1 commit intomoby:masterfrom Jun 11, 2015
Merged
Conversation
Contributor
|
ping @crosbymichael |
Previous versions of libcontainer allowed CpuShares that were greater than the maximum or less than the minimum supported by the kernel, and relied on the kernel to do the right thing. Newer libcontainer fails after creating the container if the requested CpuShares is different from what was actually created by the kernel, which breaks compatibility with earlier Docker Remote API versions. This change explicitly adjusts the requested CpuShares in API versions < 1.20. Signed-off-by: Samuel Karp <[email protected]>
28c4868 to
ed39fbe
Compare
Contributor
|
I feel like there might be a better place to put this but other than that LGTM |
Member
Author
|
Thanks @jfrazelle. I don't disagree; I was mostly trying to avoid sending the version (or a flag) even deeper into the internals. Keeping it in the API layer does this, but at the expense of making the API layer aware of kernel limits. |
Contributor
|
Thanks @samuelkarp! The original patch in libcontainer makes sense, but I agree the Docker API impact is undesirable: LGTM. |
Contributor
|
API documentation was already very vague on accepted value ("CpuShares - An integer value containing the CPU Shares for container (ie. the relative weight vs other containers"). I don't think it needs updating. |
icecrime
pushed a commit
that referenced
this pull request
Jun 11, 2015
Adjust disallowed CpuShares in /containers/create
Contributor
|
cherry-picked |
Contributor
|
Oh Man you are most awesome. |
riuvshin
pushed a commit
to riuvshin/che-plugins
that referenced
this pull request
Sep 21, 2015
…7 and above More information is here: moby/moby#13722
riuvshin
pushed a commit
to codenvy-legacy/che-plugins
that referenced
this pull request
Sep 21, 2015
…7 and above More information is here: moby/moby#13722
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous versions of libcontainer allowed CpuShares that were greater
than the maximum or less than the minimum supported by the kernel, and
relied on the kernel to do the right thing. Newer libcontainer fails
after creating the container if the requested CpuShares is different
from what was actually created by the kernel, which breaks compatibility
with earlier Docker Remote API versions. This change explicitly adjusts
the requested CpuShares in API versions < 1.20.
Signed-off-by: Samuel Karp [email protected]
Fixes #13721