From 7e79c3b05f6c7a93442eba9bee65d17b4720cebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Mon, 17 Jun 2024 14:53:32 +0200 Subject: [PATCH] Fix bug introduced in previous commit. --- pkg/controller/delay.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controller/delay.go b/pkg/controller/delay.go index c1443a9b0..da671a0f0 100644 --- a/pkg/controller/delay.go +++ b/pkg/controller/delay.go @@ -46,9 +46,12 @@ func checkScalingDelay(ctx context.Context, logger log.Logger, sts *v1.StatefulS } delay, prepareURL, err := parseDelayedDownscaleAnnotations(sts.GetAnnotations()) - if delay == 0 || prepareURL == nil || err != nil { + if err != nil { return currentReplicas, err } + if delay == 0 || prepareURL == nil { + return desiredReplicas, err + } if desiredReplicas >= currentReplicas { callCancelDelayedDownscale(ctx, logger, httpClient, createPrepareDownscaleEndpoints(sts.Namespace, sts.GetName(), 0, int(currentReplicas), prepareURL))