Skip to content

Commit 5f72472

Browse files
mook-asjedevc
authored andcommitted
Don't support cgroupns on cgroups v1
Fixes moby#4108 Signed-off-by: Mark Yen <[email protected]> (cherry picked from commit d48bf06) Signed-off-by: Justin Chadwell <[email protected]>
1 parent 1f9ad6c commit 5f72472

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

executor/oci/spec_unix.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,13 @@ func getTracingSocket() string {
149149

150150
func cgroupNamespaceSupported() bool {
151151
cgroupNSOnce.Do(func() {
152-
if _, err := os.Stat("/proc/self/ns/cgroup"); !os.IsNotExist(err) {
153-
supportsCgroupNS = true
152+
if _, err := os.Stat("/proc/self/ns/cgroup"); os.IsNotExist(err) {
153+
return
154154
}
155+
if _, err := os.Stat("/sys/fs/cgroup/cgroup.subtree_control"); os.IsNotExist(err) {
156+
return
157+
}
158+
supportsCgroupNS = true
155159
})
156160
return supportsCgroupNS
157161
}

0 commit comments

Comments
 (0)