Convert pod cgroupPath to runc format for systemd cgroup

Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
Mrunal Patel 2017-05-17 17:46:53 -07:00
parent d3bc6ab693
commit 3fefcaa1dd

View file

@ -321,14 +321,16 @@ func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
cgroupParent := req.GetConfig().GetLinux().CgroupParent cgroupParent := req.GetConfig().GetLinux().CgroupParent
if cgroupParent != "" { if cgroupParent != "" {
if s.config.CgroupManager == "systemd" { if s.config.CgroupManager == "systemd" {
cgPath := cgroupParent + ":" + "crio" + ":" + id cgPath, err := convertCgroupNameToSystemd(cgroupParent, false)
g.SetLinuxCgroupsPath(cgPath) if err != nil {
return nil, err
}
g.SetLinuxCgroupsPath(cgPath + ":" + "crio" + ":" + id)
sb.cgroupParent = cgPath
} else { } else {
g.SetLinuxCgroupsPath(cgroupParent + "/" + id) g.SetLinuxCgroupsPath(cgroupParent + "/" + id)
sb.cgroupParent = cgroupParent
} }
sb.cgroupParent = cgroupParent
} }
hostNetwork := req.GetConfig().GetLinux().GetSecurityContext().GetNamespaceOptions().HostNetwork hostNetwork := req.GetConfig().GetLinux().GetSecurityContext().GetNamespaceOptions().HostNetwork