correctly handle fields in cmdline for cgroupsv2

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2023-10-25 18:33:28 +03:00
parent 5d78de48f7
commit 0e2f17a05a

View File

@ -429,7 +429,7 @@ func isCgroupV2() bool {
log.Printf("error reading /proc/cmdline: %v", err)
return false
}
for _, s := range strings.Split(string(dt), " ") {
for _, s := range strings.Fields(string(dt)) {
if s == "linuxkit.unified_cgroup_hierarchy=1" {
return true
}