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
This commit is contained in:
Fabricio Voznika
2020-06-10 16:30:06 -07:00
committed by gVisor bot
parent 9338854ea3
commit 41d9e536d5
+1 -1
View File
@@ -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)