Skip to content

Commit

Permalink
Update resource on libcontainer change
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crosby <[email protected]>
  • Loading branch information
crosbymichael committed Dec 17, 2015
1 parent c4f3b71 commit b296d50
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b296d50

Please sign in to comment.