-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Adjust disallowed CpuShares in /containers/create #13722
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
Conversation
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 <skarp@amazon.com>
28c4868
to
ed39fbe
Compare
I feel like there might be a better place to put this but other than that LGTM |
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. |
Thanks @samuelkarp! The original patch in libcontainer makes sense, but I agree the Docker API impact is undesirable: LGTM. |
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. |
Adjust disallowed CpuShares in /containers/create
cherry-picked |
Oh Man you are most awesome. |
…7 and above More information is here: moby/moby#13722
…7 and above More information is here: moby/moby#13722
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 skarp@amazon.com
Fixes #13721