From edc75cd5656b0449541b0f4db48f0f8c32dc2230 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Thu, 10 Sep 2015 17:20:16 -0700 Subject: [PATCH] Fix the bug that determining guaranteed qos won't work well with small numbers --- pkg/kubelet/qos/util/qos.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/qos/util/qos.go b/pkg/kubelet/qos/util/qos.go index d7a1e5c88d2..0ebb1c84fa1 100644 --- a/pkg/kubelet/qos/util/qos.go +++ b/pkg/kubelet/qos/util/qos.go @@ -35,7 +35,7 @@ func isResourceGuaranteed(container *api.Container, resource api.ResourceName) b if !hasReq || !hasLimit { return false } - return req.Value() == limit.Value() && req.Value() != 0 + return req.Cmp(limit) == 0 && req.Value() != 0 } // isResourceBestEffort returns true if the container's resource requirements are best-effort.