diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-25 01:19:29 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-25 01:19:29 +0000 |
commit | 8239253b718d0c94976d8accac51a388d411cdb0 (patch) | |
tree | bd30e9be2d7ef4b669ec41376fd77b763337f5ec /runsc/cgroup | |
parent | 2c162960686cc4c0e9a1b58f9494b48ed64c5f35 (diff) | |
parent | 4af39dd1c522f7852312ecbfd3678892fc656322 (diff) |
Merge release-20200323.0-247-g4af39dd (automated)
Diffstat (limited to 'runsc/cgroup')
-rw-r--r-- | runsc/cgroup/cgroup.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go index 653ca5f52..fa40ee509 100644 --- a/runsc/cgroup/cgroup.go +++ b/runsc/cgroup/cgroup.go @@ -45,13 +45,13 @@ var controllers = map[string]controller{ "memory": &memory{}, "net_cls": &networkClass{}, "net_prio": &networkPrio{}, + "pids": &pids{}, // These controllers either don't have anything in the OCI spec or is - // irrevalant for a sandbox, e.g. pids. + // irrelevant for a sandbox. "devices": &noop{}, "freezer": &noop{}, "perf_event": &noop{}, - "pids": &noop{}, "systemd": &noop{}, } @@ -525,3 +525,13 @@ func (*networkPrio) set(spec *specs.LinuxResources, path string) error { } return nil } + +type pids struct{} + +func (*pids) set(spec *specs.LinuxResources, path string) error { + if spec.Pids == nil { + return nil + } + val := strconv.FormatInt(spec.Pids.Limit, 10) + return setValue(path, "pids.max", val) +} |