From 796b24fd214156ce45c05f3c285355143f9db8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Go=C5=82=C4=85b?= Date: Fri, 24 Aug 2018 12:44:45 +0200 Subject: [PATCH] Compare in overflow-safe way --- .../pkg/updater/priority/update_priority_calculator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vertical-pod-autoscaler/pkg/updater/priority/update_priority_calculator.go b/vertical-pod-autoscaler/pkg/updater/priority/update_priority_calculator.go index df41d2a8b074..a9c93a858ff5 100644 --- a/vertical-pod-autoscaler/pkg/updater/priority/update_priority_calculator.go +++ b/vertical-pod-autoscaler/pkg/updater/priority/update_priority_calculator.go @@ -157,8 +157,8 @@ func (calc *UpdatePriorityCalculator) getUpdatePriority(pod *apiv1.Pod, recommen if recommended.MilliValue() > request.MilliValue() { scaleUp = true } - if (hasLowerBound && request.MilliValue() < lowerBound.MilliValue()) || - (hasUpperBound && request.MilliValue() > upperBound.MilliValue()) { + if (hasLowerBound && request.Cmp(lowerBound) < 0) || + (hasUpperBound && request.Cmp(upperBound) > 0) { outsideRecommendedRange = true } } else {