diff options
author | Fabricio Voznika <fvoznika@google.com> | 2020-06-10 16:28:20 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-10 16:30:06 -0700 |
commit | 41d9e536d559a2066ed6c92ed30aa2757d3596bb (patch) | |
tree | b91238f6ec5a01ded851636cfcfc13454767e10c /runsc | |
parent | 9338854ea31059d6b6b5bf59a12512455b632f49 (diff) |
Skip pids.max if value is zero
LinuxPids.Limit is the only optional cgroup field in OCI that
is not a pointer. If value is 0 or negative it should be
skipped.
PiperOrigin-RevId: 315791909
Diffstat (limited to 'runsc')
-rw-r--r-- | runsc/cgroup/cgroup.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go index ef01820ef..5698cab4f 100644 --- a/runsc/cgroup/cgroup.go +++ b/runsc/cgroup/cgroup.go @@ -545,7 +545,7 @@ func (*networkPrio) set(spec *specs.LinuxResources, path string) error { type pids struct{} func (*pids) set(spec *specs.LinuxResources, path string) error { - if spec.Pids == nil { + if spec.Pids == nil || spec.Pids.Limit <= 0 { return nil } val := strconv.FormatInt(spec.Pids.Limit, 10) |