Skip to content

Commit

Permalink
Merge pull request #43649 from AkihiroSuda/fix-43646
Browse files Browse the repository at this point in the history
Fix constant `WARNING: No swap limit support` on cgroup v2 hosts
  • Loading branch information
thaJeztah committed May 27, 2022
2 parents 262f574 + a04e332 commit 69adaa8
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 27 deletions.
3 changes: 1 addition & 2 deletions pkg/sysinfo/cgroup2_linux.go
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
2 changes: 1 addition & 1 deletion vendor.mod
Expand Up @@ -17,7 +17,7 @@ require (
github.com/aws/aws-sdk-go v1.31.6
github.com/bsphere/le_go v0.0.0-20170215134836-7a984a84b549
github.com/cloudflare/cfssl v0.0.0-20180323000720-5d63dbd981b5
github.com/containerd/cgroups v1.0.3
github.com/containerd/cgroups v1.0.4
github.com/containerd/containerd v1.6.4
github.com/containerd/continuity v0.3.0
github.com/containerd/fifo v1.0.0
Expand Down
3 changes: 2 additions & 1 deletion vendor.sum
Expand Up @@ -209,8 +209,9 @@ github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4S
github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE=
github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU=
github.com/containerd/cgroups v1.0.3 h1:ADZftAkglvCiD44c77s5YmMqaP2pzVCFZvBmAlBdAP4=
github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8=
github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA=
github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA=
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/containerd/cgroups/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/github.com/containerd/cgroups/Vagrantfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 19 additions & 10 deletions vendor/github.com/containerd/cgroups/utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 41 additions & 5 deletions vendor/github.com/containerd/cgroups/v2/manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/containerd/cgroups/v2/memory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/containerd/cgroups/v2/utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Expand Up @@ -144,8 +144,8 @@ github.com/cloudflare/cfssl/signer/local
# github.com/container-storage-interface/spec v1.5.0
## explicit; go 1.16
github.com/container-storage-interface/spec/lib/go/csi
# github.com/containerd/cgroups v1.0.3
## explicit; go 1.16
# github.com/containerd/cgroups v1.0.4
## explicit; go 1.17
github.com/containerd/cgroups
github.com/containerd/cgroups/stats/v1
github.com/containerd/cgroups/v2
Expand Down

0 comments on commit 69adaa8

Please sign in to comment.