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

@ -252,8 +252,12 @@ func (s *Server) createSandboxContainer(containerID string, containerName string
}
if sb.cgroupParent != "" {
// NOTE: we only support cgroupfs for now, discussion happens in issue #270.
specgen.SetLinuxCgroupsPath(sb.cgroupParent + "/" + containerID)
if s.config.CgroupManager == "systemd" {
cgPath := sb.cgroupParent + ":" + "ocid" + ":" + containerID
specgen.SetLinuxCgroupsPath(cgPath)
} else {
specgen.SetLinuxCgroupsPath(sb.cgroupParent + "/" + containerID)
}
}
capabilities := linux.GetSecurityContext().GetCapabilities()