File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff 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.
264263func 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}
You can’t perform that action at this time.
0 commit comments