Update resource on libcontainer change

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-12-17 13:58:50 -08:00
parent c4f3b71344
commit b296d50493
1 changed files with 7 additions and 4 deletions

View File

@ -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) {
c := &configs.Cgroup{
Name: name,
Parent: "/containerd",
cr := &configs.Cgroup{
Name: name,
Parent: "/containerd",
}
c := &configs.Resources{
AllowedDevices: append(devices, allowedDevices...),
}
cr.Resources = c
r := spec.Linux.Resources
c.Memory = int64(r.Memory.Limit)
c.MemoryReservation = int64(r.Memory.Reservation)
@ -671,7 +674,7 @@ func (rt *libcontainerRuntime) createCgroupConfig(name string, spec *specs.Linux
Priority: int64(m.Priority),
})
}
return c, nil
return cr, nil
}
func (r *libcontainerRuntime) createDevices(spec *specs.LinuxRuntimeSpec, config *configs.Config) error {