mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
podman: fix --cgroups=disabled
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -119,13 +119,13 @@ func getIOLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) (
|
|||||||
func getPidsLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) (*specs.LinuxPids, error) {
|
func getPidsLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) (*specs.LinuxPids, error) {
|
||||||
pids := &specs.LinuxPids{}
|
pids := &specs.LinuxPids{}
|
||||||
hasLimits := false
|
hasLimits := false
|
||||||
|
if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
if c.PIDsLimit > 0 {
|
if c.PIDsLimit > 0 {
|
||||||
pids.Limit = c.PIDsLimit
|
pids.Limit = c.PIDsLimit
|
||||||
hasLimits = true
|
hasLimits = true
|
||||||
}
|
}
|
||||||
if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
|
|
||||||
s.ResourceLimits.Pids.Limit = -1
|
|
||||||
}
|
|
||||||
if !hasLimits {
|
if !hasLimits {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
@ -937,7 +937,6 @@ USER mail`
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run with cgroups=disabled runs without cgroups", func() {
|
It("podman run with cgroups=disabled runs without cgroups", func() {
|
||||||
Skip(v2fail)
|
|
||||||
SkipIfRemote()
|
SkipIfRemote()
|
||||||
SkipIfRootless()
|
SkipIfRootless()
|
||||||
// Only works on crun
|
// Only works on crun
|
||||||
|
Reference in New Issue
Block a user