Merge pull request #23858 from Hitachi/fix-cgroup-path

libpod: fix rootless cgroup path with --cgroup-parent
This commit is contained in:
openshift-merge-bot[bot]
2024-09-04 16:58:51 +00:00
committed by GitHub

View File

@ -120,7 +120,7 @@ func assembleSystemdCgroupName(baseSlice, newSlice string) (string, string, erro
// When we run as rootless, the cgroup has a path like the following: // When we run as rootless, the cgroup has a path like the following:
///sys/fs/cgroup/user.slice/user-@$UID.slice/user@$UID.service/user.slice/user-libpod_pod_$POD_ID.slice ///sys/fs/cgroup/user.slice/user-@$UID.slice/user@$UID.service/user.slice/user-libpod_pod_$POD_ID.slice
uid := rootless.GetRootlessUID() uid := rootless.GetRootlessUID()
raw := fmt.Sprintf("user.slice/%s-%d.slice/user@%d.service/%s/%s-%s%s", noSlice, uid, uid, baseSlice, noSlice, newSlice, sliceSuffix) raw := fmt.Sprintf("user.slice/user-%d.slice/user@%d.service/%s/%s-%s%s", uid, uid, baseSlice, noSlice, newSlice, sliceSuffix)
return raw, systemdPath, nil return raw, systemdPath, nil
} }
return systemdPath, systemdPath, nil return systemdPath, systemdPath, nil