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 --- libpod/kube.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod') 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 { -- cgit v1.2.3-54-g00ecf