From ae2c27eb07b31408aa0da44f8fac08eb95ef1c00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 08:50:26 +0000 Subject: [PATCH] Update module github.com/opencontainers/cgroups to v0.0.8 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- .../opencontainers/cgroups/getallpids.go | 17 +++++++++++++++++ vendor/modules.txt | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index b4e58a6889..10f5c3fde1 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/nxadm/tail v1.4.11 github.com/onsi/ginkgo/v2 v2.32.0 github.com/onsi/gomega v1.42.1 - github.com/opencontainers/cgroups v0.0.7 + github.com/opencontainers/cgroups v0.0.8 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.1 github.com/opencontainers/runtime-spec v1.3.0 diff --git a/go.sum b/go.sum index fae6f9017e..a7e2cf546c 100644 --- a/go.sum +++ b/go.sum @@ -281,8 +281,8 @@ github.com/onsi/ginkgo/v2 v2.32.0 h1:Hw7s2pVrQo/8Yz5N77qdnpHaoc+c6cC9WIV1Jce+J6E github.com/onsi/ginkgo/v2 v2.32.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I= github.com/onsi/gomega v1.42.1/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg= -github.com/opencontainers/cgroups v0.0.7 h1:FqhggFhigAMgKKwy39jweWX3h7Ha6VBF/qNR6Sso3oc= -github.com/opencontainers/cgroups v0.0.7/go.mod h1:hPBRvnBhLZueEN0eJyozMeM3HeFGYlZW9KnO//px6G4= +github.com/opencontainers/cgroups v0.0.8 h1:dQZyCsB73ggKJUzNl4FLbpvArrLv1tLOjMYPHswdUrI= +github.com/opencontainers/cgroups v0.0.8/go.mod h1:hPBRvnBhLZueEN0eJyozMeM3HeFGYlZW9KnO//px6G4= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= diff --git a/vendor/github.com/opencontainers/cgroups/getallpids.go b/vendor/github.com/opencontainers/cgroups/getallpids.go index 1355a51010..ecd60a4448 100644 --- a/vendor/github.com/opencontainers/cgroups/getallpids.go +++ b/vendor/github.com/opencontainers/cgroups/getallpids.go @@ -1,8 +1,12 @@ package cgroups import ( + "errors" "io/fs" + "os" "path/filepath" + + "golang.org/x/sys/unix" ) // GetAllPids returns all pids from the cgroup identified by path, and all its @@ -11,6 +15,11 @@ func GetAllPids(path string) ([]int, error) { var pids []int err := filepath.WalkDir(path, func(p string, d fs.DirEntry, iErr error) error { if iErr != nil { + // A descendant cgroup can be removed while we walk, ignore + // any such error unless it's on the root (path) cgroup here + if p != path && ignoreCgroupRemoved(iErr) { + return nil + } return iErr } if !d.IsDir() { @@ -18,6 +27,9 @@ func GetAllPids(path string) ([]int, error) { } cPids, err := readProcsFile(p) if err != nil { + if p != path && ignoreCgroupRemoved(err) { + return nil + } return err } pids = append(pids, cPids...) @@ -25,3 +37,8 @@ func GetAllPids(path string) ([]int, error) { }) return pids, err } + +// ignoreCgroupRemoved reports whether err indicates the cgroup was removed. +func ignoreCgroupRemoved(err error) bool { + return os.IsNotExist(err) || errors.Is(err, unix.ENODEV) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 82bed3e678..9e3e29ad62 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -479,7 +479,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/opencontainers/cgroups v0.0.7 +# github.com/opencontainers/cgroups v0.0.8 ## explicit; go 1.24.0 github.com/opencontainers/cgroups github.com/opencontainers/cgroups/devices/config