diff options
author | Aleksandr Razumov <a.razumov@corp.mail.ru> | 2019-12-17 13:06:42 +0300 |
---|---|---|
committer | Aleksandr Razumov <a.razumov@corp.mail.ru> | 2019-12-17 13:27:13 +0300 |
commit | b661434202672f920291bf5685b68772103c66cb (patch) | |
tree | b242497f07ca106a2600910a5cd8b8ff865b23ca /runsc/main.go | |
parent | 8782f0e287df2a2fd9f9dfb3f0e1589cc15a4f91 (diff) |
Add minimum CPU number and only lower CPUs on --cpu-num-from-quota
* Add `--cpu-num-min` flag to control minimum CPUs
* Only lower CPU count
* Fix comments
Diffstat (limited to 'runsc/main.go')
-rw-r--r-- | runsc/main.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runsc/main.go b/runsc/main.go index febd59aed..7c60cbb4b 100644 --- a/runsc/main.go +++ b/runsc/main.go @@ -82,7 +82,8 @@ var ( numNetworkChannels = flag.Int("num-network-channels", 1, "number of underlying channels(FDs) to use for network link endpoints.") rootless = flag.Bool("rootless", false, "it allows the sandbox to be started with a user that is not root. Sandbox and Gofer processes may run with same privileges as current user.") referenceLeakMode = flag.String("ref-leak-mode", "disabled", "sets reference leak check mode: disabled (default), log-names, log-traces.") - cpuNumFromQuota = flag.Bool("cpu-num-from-quota", false, "set cpu number to cpu quota (least integer greater than quota value)") + cpuNumFromQuota = flag.Bool("cpu-num-from-quota", false, "set cpu number to cpu quota (least integer greater or equal to quota value)") + cpuNumMin = flag.Int("cpu-num-min", 2, "minimum number of cpu to use with --cpu-num-from-quota") // Test flags, not to be used outside tests, ever. testOnlyAllowRunAsCurrentUserWithoutChroot = flag.Bool("TESTONLY-unsafe-nonroot", false, "TEST ONLY; do not ever use! This skips many security measures that isolate the host from the sandbox.") @@ -227,6 +228,7 @@ func main() { ReferenceLeakMode: refsLeakMode, OverlayfsStaleRead: *overlayfsStaleRead, CPUNumFromQuota: *cpuNumFromQuota, + CPUNumMin: *cpuNumMin, TestOnlyAllowRunAsCurrentUserWithoutChroot: *testOnlyAllowRunAsCurrentUserWithoutChroot, TestOnlyTestNameEnv: *testOnlyTestNameEnv, |