Explorar el Código

Fix constant `WARNING: No swap limit support` on cgroup v2 hosts

Fix issue 43646

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Akihiro Suda hace 3 años
padre
commit
a04e3326e7
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      pkg/sysinfo/cgroup2_linux.go

+ 1 - 2
pkg/sysinfo/cgroup2_linux.go

@@ -56,12 +56,11 @@ func newV2(options ...Opt) *SysInfo {
 }
 
 func getSwapLimitV2() bool {
-	groups, err := cgroups.ParseCgroupFile("/proc/self/cgroup")
+	_, g, err := cgroups.ParseCgroupFileUnified("/proc/self/cgroup")
 	if err != nil {
 		return false
 	}
 
-	g := groups[""]
 	if g == "" {
 		return false
 	}