From 413eae79d868594cbb3736dc4df59a1ec71d49d0 Mon Sep 17 00:00:00 2001 From: Waquid Valiya Peedikakkal Date: Sun, 23 Nov 2025 22:20:24 +0000 Subject: [PATCH] func: don't consider count if direction is none when calculating if scaling is needed --- policy/handler.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/policy/handler.go b/policy/handler.go index 0ad51908..59d3383d 100644 --- a/policy/handler.go +++ b/policy/handler.go @@ -334,10 +334,7 @@ func (h *Handler) Run(ctx context.Context) { } func scalingNeeded(a sdk.ScalingAction, countCount int64) bool { - // The DAS returns count but the direction is none, for vertical and horizontal - // policies checking the direction is enough. - return (a.Direction == sdk.ScaleDirectionNone && countCount != a.Count) || - a.Direction != sdk.ScaleDirectionNone + return a.Direction != sdk.ScaleDirectionNone && countCount != a.Count } func (h *Handler) waitAndScale(ctx context.Context) error {