Skip to content

Commit 8b802ae

Browse files
committed
pkg/specgen/namespaces.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 089f998 commit 8b802ae

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

pkg/specgen/namespaces.go

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
spec "github.com/opencontainers/runtime-spec/specs-go"
1515
"github.com/opencontainers/runtime-tools/generate"
1616
"go.podman.io/common/libnetwork/types"
17-
"go.podman.io/common/pkg/cgroups"
1817
"go.podman.io/common/pkg/config"
1918
"go.podman.io/storage/pkg/fileutils"
2019
"go.podman.io/storage/pkg/unshare"
@@ -263,23 +262,13 @@ func ParseNamespace(ns string) (Namespace, error) {
263262
// form.
264263
func ParseCgroupNamespace(ns string) (Namespace, error) {
265264
toReturn := Namespace{}
266-
// Cgroup is host for v1, private for v2.
267-
// We can't trust c/common for this, as it only assumes private.
268-
cgroupsv2, err := cgroups.IsCgroup2UnifiedMode()
269-
if err != nil {
270-
return toReturn, err
271-
}
272-
if cgroupsv2 {
273-
switch ns {
274-
case "host":
275-
toReturn.NSMode = Host
276-
case "private", "":
277-
toReturn.NSMode = Private
278-
default:
279-
return toReturn, fmt.Errorf("unrecognized cgroup namespace mode %s passed", ns)
280-
}
281-
} else {
265+
switch ns {
266+
case "host":
282267
toReturn.NSMode = Host
268+
case "private", "":
269+
toReturn.NSMode = Private
270+
default:
271+
return toReturn, fmt.Errorf("unrecognized cgroup namespace mode %s passed", ns)
283272
}
284273
return toReturn, nil
285274
}

0 commit comments

Comments
 (0)