diff --git a/libcontainer/specconv/spec_linux.go b/libcontainer/specconv/spec_linux.go index 16e9bac6c..125f79547 100644 --- a/libcontainer/specconv/spec_linux.go +++ b/libcontainer/specconv/spec_linux.go @@ -445,7 +445,7 @@ func CreateCgroupConfig(opts *CreateOpts, defaultDevs []*devices.Device) (*confi if useSystemdCgroup { if myCgroupPath == "" { - c.Parent = "system.slice" + // Default for c.Parent is set by systemd cgroup drivers. c.ScopePrefix = "runc" c.Name = name } else { diff --git a/libcontainer/specconv/spec_linux_test.go b/libcontainer/specconv/spec_linux_test.go index dc880f32c..f4dc860fe 100644 --- a/libcontainer/specconv/spec_linux_test.go +++ b/libcontainer/specconv/spec_linux_test.go @@ -345,7 +345,7 @@ func TestLinuxCgroupSystemdWithEmptyPath(t *testing.T) { t.Errorf("Couldn't create Cgroup config: %v", err) } - expectedParent := "system.slice" + expectedParent := "" if cgroup.Parent != expectedParent { t.Errorf("Expected to have %s as Parent instead of %s", expectedParent, cgroup.Parent) }