From 03579649063d669f9f57d534f74136befef98c62 Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Sat, 31 Oct 2020 09:32:52 -0500 Subject: Centralize cores and period/quota conversion code Signed-off-by: Jordan Christiansen --- cmd/podman/common/specgen.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'cmd') 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 = "a -- cgit v1.2.3-54-g00ecf