mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +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) {
|
||||
pids := &specs.LinuxPids{}
|
||||
hasLimits := false
|
||||
if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if c.PIDsLimit > 0 {
|
||||
pids.Limit = c.PIDsLimit
|
||||
hasLimits = true
|
||||
}
|
||||
if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
|
||||
s.ResourceLimits.Pids.Limit = -1
|
||||
}
|
||||
if !hasLimits {
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -937,7 +937,6 @@ USER mail`
|
||||
})
|
||||
|
||||
It("podman run with cgroups=disabled runs without cgroups", func() {
|
||||
Skip(v2fail)
|
||||
SkipIfRemote()
|
||||
SkipIfRootless()
|
||||
// Only works on crun
|
||||
|
Reference in New Issue
Block a user