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>
This commit is contained in:
parent
2f6b8a2aec
commit
a04e3326e7
1 changed files with 1 additions and 2 deletions
|
@ -56,12 +56,11 @@ func newV2(options ...Opt) *SysInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSwapLimitV2() bool {
|
func getSwapLimitV2() bool {
|
||||||
groups, err := cgroups.ParseCgroupFile("/proc/self/cgroup")
|
_, g, err := cgroups.ParseCgroupFileUnified("/proc/self/cgroup")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
g := groups[""]
|
|
||||||
if g == "" {
|
if g == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue