mirror of https://github.com/containers/podman.git
Merge pull request #14764 from cdoern/cgroup
limit cgroupfs when rootless
This commit is contained in:
commit
dd924c4078
|
@ -78,6 +78,8 @@ func (r *Runtime) NewPod(ctx context.Context, p specgen.PodSpecGenerator, option
|
||||||
pod.state.CgroupPath = filepath.Join(pod.config.CgroupParent, pod.ID())
|
pod.state.CgroupPath = filepath.Join(pod.config.CgroupParent, pod.ID())
|
||||||
if p.InfraContainerSpec != nil {
|
if p.InfraContainerSpec != nil {
|
||||||
p.InfraContainerSpec.CgroupParent = pod.state.CgroupPath
|
p.InfraContainerSpec.CgroupParent = pod.state.CgroupPath
|
||||||
|
// cgroupfs + rootless = permission denied when creating the cgroup.
|
||||||
|
if !rootless.IsRootless() {
|
||||||
res, err := GetLimits(p.InfraContainerSpec.ResourceLimits)
|
res, err := GetLimits(p.InfraContainerSpec.ResourceLimits)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -97,6 +99,7 @@ func (r *Runtime) NewPod(ctx context.Context, p specgen.PodSpecGenerator, option
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case config.SystemdCgroupsManager:
|
case config.SystemdCgroupsManager:
|
||||||
if pod.config.CgroupParent == "" {
|
if pod.config.CgroupParent == "" {
|
||||||
if rootless.IsRootless() {
|
if rootless.IsRootless() {
|
||||||
|
|
Loading…
Reference in New Issue