summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-02 16:02:55 +0100
committerGitHub <noreply@github.com>2020-11-02 16:02:55 +0100
commit7375a55757fe7615f133db5b097bb4db9a244888 (patch)
tree6d29d221f696c3aabfa1e847d92f55da41cb27e9 /cmd/podman
parent8bc0f51e330185bed1be4bcfffd04729b4bc9cd4 (diff)
parent03579649063d669f9f57d534f74136befef98c62 (diff)
downloadpodman-7375a55757fe7615f133db5b097bb4db9a244888.tar.gz
podman-7375a55757fe7615f133db5b097bb4db9a244888.tar.bz2
podman-7375a55757fe7615f133db5b097bb4db9a244888.zip
Merge pull request #8207 from xordspar0/common-period-quota
Centralize cores and period/quota conversion code
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/specgen.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index bd3e5fafd..ca1e25be1 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -25,11 +25,8 @@ func getCPULimits(c *ContainerCLIOpts) *specs.LinuxCPU {
cpu := &specs.LinuxCPU{}
hasLimits := false
- const cpuPeriod = 100000
-
if c.CPUS > 0 {
- quota := int64(c.CPUS * cpuPeriod)
- period := uint64(cpuPeriod)
+ period, quota := util.CoresToPeriodAndQuota(c.CPUS)
cpu.Period = &period
cpu.Quota = &quota