summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2021-09-29 16:22:55 -0400
committerUrvashi Mohnani <umohnani@redhat.com>2021-09-29 16:22:55 -0400
commitc25cc7230fa1d54903728626584d30808539cc04 (patch)
tree436f89e19d5782c348a9e893eeaffd7d0ba1b4cb /pkg/specgen
parentd987f26f1e2449d3237faa0b873d82ce5a89e0ee (diff)
downloadpodman-c25cc7230fa1d54903728626584d30808539cc04.tar.gz
podman-c25cc7230fa1d54903728626584d30808539cc04.tar.bz2
podman-c25cc7230fa1d54903728626584d30808539cc04.zip
Allow a value of -1 to set unlimited pids limit
Users can set --pids-limit to -1 now to set unlimited pids limit for a container - this matches the convention. [NO TESTS NEEDED] Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/validate.go3
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
}