mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 14:54:19 +01:00
sandbox: don't constrain cpus, mem only cpuset, devices
Allow for constraining the cpuset as well as the devices-whitelist . Revert sandbox constraints for cpu/memory, as they break the K8S use case. Can re-add behind a non-default flag in the future. The sandbox CPUSet should be updated every time a container is created, updated, or removed. To facilitate this without rewriting the 'non constrained cgroup' handling, let's add to the Sandbox's cgroupsUpdate function. Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
@@ -1139,6 +1139,12 @@ func (c *Container) update(resources specs.LinuxResources) error {
|
||||
if q := cpu.Quota; q != nil && *q != 0 {
|
||||
c.config.Resources.CPU.Quota = q
|
||||
}
|
||||
if cpu.Cpus != "" {
|
||||
c.config.Resources.CPU.Cpus = cpu.Cpus
|
||||
}
|
||||
if cpu.Mems != "" {
|
||||
c.config.Resources.CPU.Mems = cpu.Mems
|
||||
}
|
||||
}
|
||||
|
||||
if c.config.Resources.Memory == nil {
|
||||
|
||||
Reference in New Issue
Block a user