Update resource on libcontainer change
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
c4f3b71344
commit
b296d50493
1 changed files with 7 additions and 4 deletions
|
@ -617,11 +617,14 @@ func (r *libcontainerRuntime) createLibcontainerMount(cwd, dest string, m specs.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rt *libcontainerRuntime) createCgroupConfig(name string, spec *specs.LinuxRuntimeSpec, devices []*configs.Device) (*configs.Cgroup, error) {
|
func (rt *libcontainerRuntime) createCgroupConfig(name string, spec *specs.LinuxRuntimeSpec, devices []*configs.Device) (*configs.Cgroup, error) {
|
||||||
c := &configs.Cgroup{
|
cr := &configs.Cgroup{
|
||||||
Name: name,
|
Name: name,
|
||||||
Parent: "/containerd",
|
Parent: "/containerd",
|
||||||
|
}
|
||||||
|
c := &configs.Resources{
|
||||||
AllowedDevices: append(devices, allowedDevices...),
|
AllowedDevices: append(devices, allowedDevices...),
|
||||||
}
|
}
|
||||||
|
cr.Resources = c
|
||||||
r := spec.Linux.Resources
|
r := spec.Linux.Resources
|
||||||
c.Memory = int64(r.Memory.Limit)
|
c.Memory = int64(r.Memory.Limit)
|
||||||
c.MemoryReservation = int64(r.Memory.Reservation)
|
c.MemoryReservation = int64(r.Memory.Reservation)
|
||||||
|
@ -671,7 +674,7 @@ func (rt *libcontainerRuntime) createCgroupConfig(name string, spec *specs.Linux
|
||||||
Priority: int64(m.Priority),
|
Priority: int64(m.Priority),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return c, nil
|
return cr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *libcontainerRuntime) createDevices(spec *specs.LinuxRuntimeSpec, config *configs.Config) error {
|
func (r *libcontainerRuntime) createDevices(spec *specs.LinuxRuntimeSpec, config *configs.Config) error {
|
||||||
|
|
Loading…
Add table
Reference in a new issue