Add support for systemd cgroups

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
Mrunal Patel 2016-12-19 15:06:27 -08:00
parent 5eab56e002
commit 6df58df215
4 changed files with 38 additions and 14 deletions

View file

@ -245,8 +245,14 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
// setup cgroup settings
cgroupParent := req.GetConfig().GetLinux().GetCgroupParent()
if cgroupParent != "" {
// NOTE: we only support cgroupfs for now, discussion happens in issue #270.
g.SetLinuxCgroupsPath(cgroupParent + "/" + containerID)
if s.config.CgroupManager == "systemd" {
cgPath := sb.cgroupParent + ":" + "ocid" + ":" + containerID
g.SetLinuxCgroupsPath(cgPath)
} else {
g.SetLinuxCgroupsPath(sb.cgroupParent + "/" + containerID)
}
sb.cgroupParent = cgroupParent
}