diff --git a/internal/cgroups/cgroups2.go b/internal/cgroups/cgroups2.go index 4f41469..66930d0 100644 --- a/internal/cgroups/cgroups2.go +++ b/internal/cgroups/cgroups2.go @@ -89,7 +89,7 @@ func isCGroupV2(procPathMountInfo string) (bool, error) { var ( isV2 bool newMountPoint = func(mp *MountPoint) error { - isV2 = mp.FSType == _cgroupv2FSType && mp.MountPoint == _cgroupv2MountPoint + isV2 = isV2 || (mp.FSType == _cgroupv2FSType && mp.MountPoint == _cgroupv2MountPoint) return nil } ) diff --git a/internal/cgroups/testdata/proc/v2/mountinfo-v2 b/internal/cgroups/testdata/proc/v2/mountinfo-v2 index 65488d1..c4d6116 100644 --- a/internal/cgroups/testdata/proc/v2/mountinfo-v2 +++ b/internal/cgroups/testdata/proc/v2/mountinfo-v2 @@ -1 +1,2 @@ -34 33 0:29 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:10 - cgroup2 cgroup rw,nsdelegate \ No newline at end of file +34 33 0:29 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime shared:10 - cgroup2 cgroup rw,nsdelegate +34 33 0:29 / /sys/fs/foo rw,nosuid,nodev,noexec,relatime shared:10 - foo cgroup rw,nsdelegate