fix(deps): update module github.com/opencontainers/cgroups to v0.0.2

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2025-04-28 18:19:46 +00:00
committed by GitHub
parent a2d542df37
commit 6c9f378a9b
15 changed files with 141 additions and 78 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"strings"
"sync"
"syscall"
@ -144,10 +145,8 @@ func FindCgroupMountpointAndRoot(cgroupPath, subsystem string) (string, string,
func findCgroupMountpointAndRootFromMI(mounts []*mountinfo.Info, cgroupPath, subsystem string) (string, string, error) {
for _, mi := range mounts {
if strings.HasPrefix(mi.Mountpoint, cgroupPath) {
for _, opt := range strings.Split(mi.VFSOptions, ",") {
if opt == subsystem {
return mi.Mountpoint, mi.Root, nil
}
if slices.Contains(strings.Split(mi.VFSOptions, ","), subsystem) {
return mi.Mountpoint, mi.Root, nil
}
}
}