Skip to content

Commit

Permalink
Don't support cgroupns on cgroups v1
Browse files Browse the repository at this point in the history
Fixes moby#4108

Signed-off-by: Mark Yen <mark.yen@suse.com>
  • Loading branch information
mook-as authored and nxmatic committed Dec 3, 2023
1 parent 909e746 commit 785037b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions executor/oci/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ func getTracingSocket() string {

func cgroupNamespaceSupported() bool {
cgroupNSOnce.Do(func() {
if _, err := os.Stat("/proc/self/ns/cgroup"); !os.IsNotExist(err) {
supportsCgroupNS = true
if _, err := os.Stat("/proc/self/ns/cgroup"); os.IsNotExist(err) {
return
}
if _, err := os.Stat("/sys/fs/cgroup/cgroup.subtree_control"); os.IsNotExist(err) {
return
}
supportsCgroupNS = true
})
return supportsCgroupNS
}

0 comments on commit 785037b

Please sign in to comment.