mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-07 06:22:03 +00:00
Adjust disallowed CpuShares in /containers/create
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>
(cherry picked from commit ed39fbeb2a)
This commit is contained in:
committed by
Jessica Frazelle
parent
9fc1c4efb9
commit
984be835db
@@ -903,6 +903,7 @@ func (s *Server) postContainersCreate(version version.Version, w http.ResponseWr
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
adjustCpuShares(version, hostConfig)
|
||||
|
||||
containerId, warnings, err := s.daemon.ContainerCreate(name, config, hostConfig)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user