Skip to content

Commit

Permalink
Fix bug introduced in previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstibrany committed Jun 17, 2024
1 parent f7fcdb0 commit 7e79c3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/delay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7e79c3b

Please sign in to comment.