Skip to content

Commit

Permalink
Fix constant WARNING: No swap limit support on cgroup v2 hosts
Browse files Browse the repository at this point in the history
Fix issue 43646

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed May 27, 2022
1 parent 2f6b8a2 commit a04e332
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/sysinfo/cgroup2_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a04e332

Please sign in to comment.