diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-30 15:14:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 15:14:28 -0400 |
commit | 5c2204b5cea9f310d0c06f181cfa64b6658823e6 (patch) | |
tree | 9ecc2baec9b21d0d56e0a2e05c3b671ed7b61196 /pkg/specgen/generate/validate.go | |
parent | 1f3e2ed74ff833a25fcf7b0f796b6a9569cf362d (diff) | |
parent | c25cc7230fa1d54903728626584d30808539cc04 (diff) | |
download | podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.tar.gz podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.tar.bz2 podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.zip |
Merge pull request #11794 from umohnani8/pid
Allow a value of -1 to set unlimited pids limit
Diffstat (limited to 'pkg/specgen/generate/validate.go')
-rw-r--r-- | pkg/specgen/generate/validate.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/specgen/generate/validate.go b/pkg/specgen/generate/validate.go index 50efe7fa3..b0d84825e 100644 --- a/pkg/specgen/generate/validate.go +++ b/pkg/specgen/generate/validate.go @@ -72,10 +72,9 @@ func verifyContainerResourcesCgroupV1(s *specgen.SpecGenerator) ([]string, error // Pids checks if s.ResourceLimits.Pids != nil { - pids := s.ResourceLimits.Pids // TODO: Should this be 0, or checking that ResourceLimits.Pids // is set at all? - if pids.Limit > 0 && !sysInfo.PidsLimit { + if s.ResourceLimits.Pids.Limit >= 0 && !sysInfo.PidsLimit { warnings = append(warnings, "Your kernel does not support pids limit capabilities or the cgroup is not mounted. PIDs limit discarded.") s.ResourceLimits.Pids = nil } |