From 41d9e536d559a2066ed6c92ed30aa2757d3596bb Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Wed, 10 Jun 2020 16:28:20 -0700 Subject: 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 --- runsc/cgroup/cgroup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runsc') 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) -- cgit v1.2.3