Skip to content

Commit

Permalink
Add log message when downscale delay is reached.
Browse files Browse the repository at this point in the history
  • Loading branch information
pstibrany committed Feb 2, 2024
1 parent c1213ac commit 4c90467
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/delay.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func checkScalingDelay(ctx context.Context, logger log.Logger, sts *v1.StatefulS

if desiredReplicas > currentReplicas {
callCancelDelayedDownscale(ctx, logger, httpClient, createEndpoints(sts.Namespace, sts.GetName(), 0, int(currentReplicas), prepareURL))
// Proceed even if calling cancel of delayed downscale fails. We call it repeatedly.
// Proceed even if calling cancel of delayed downscale fails. We call cancellation repeatedly, so it will happen during next reconcile.
return nil
}

Expand All @@ -72,6 +72,7 @@ func checkScalingDelay(ctx context.Context, logger log.Logger, sts *v1.StatefulS
}

// We can proceed with downscale!
level.Info(logger).Log("msg", "downscale delay has been reached on all downscaled pods, proceeding with downscale", "name", sts.GetName(), "delay", delay, "elapsed", elapsedSinceMaxTime)
return nil
}

Expand Down

0 comments on commit 4c90467

Please sign in to comment.