summaryrefslogtreecommitdiff
path: root/libpod/kube.go
diff options
context:
space:
mode:
authorJordan Christiansen <xordspar0@gmail.com>2020-10-31 09:32:52 -0500
committerJordan Christiansen <xordspar0@gmail.com>2020-10-31 10:07:11 -0500
commit03579649063d669f9f57d534f74136befef98c62 (patch)
tree3b2d9d5e5e52c46c53d6e5b9c439f26067f9a0b2 /libpod/kube.go
parent2aaa036f560e2c42ebb033869eeef539dbc47fef (diff)
downloadpodman-03579649063d669f9f57d534f74136befef98c62.tar.gz
podman-03579649063d669f9f57d534f74136befef98c62.tar.bz2
podman-03579649063d669f9f57d534f74136befef98c62.zip
Centralize cores and period/quota conversion code
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
Diffstat (limited to 'libpod/kube.go')
-rw-r--r--libpod/kube.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index cd5064c84..067e7827d 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -327,7 +327,7 @@ func containerToV1Container(c *Container) (v1.Container, []v1.Volume, error) {
period := *c.config.Spec.Linux.Resources.CPU.Period
if quota > 0 && period > 0 {
- cpuLimitMilli := int64(1000 * float64(quota) / float64(period))
+ cpuLimitMilli := int64(1000 * util.PeriodAndQuotaToCores(period, quota))
// Kubernetes: precision finer than 1m is not allowed
if cpuLimitMilli >= 1 {