Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update on scaler limited to Max #2446

Merged
merged 8 commits into from
Jan 27, 2022
7 changes: 6 additions & 1 deletion pkg/fleetautoscalers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ func (c *Controller) updateStatus(ctx context.Context, fas *autoscalingv1.FleetA

if !apiequality.Semantic.DeepEqual(fas.Status, fasCopy.Status) {
if scalingLimited {
c.recorder.Eventf(fas, corev1.EventTypeWarning, "ScalingLimited", "Scaling fleet %s was limited to maximum size of %d", fas.Spec.FleetName, desiredReplicas)
// scalingLimited indicates that the calculated scale would be above or below the range defined by MinReplicas and MaxReplicas
if currentReplicas > desiredReplicas {
c.recorder.Eventf(fas, corev1.EventTypeWarning, "ScalingLimited", "Scaling fleet %s was limited to maximum size of %d", fas.Spec.FleetName, desiredReplicas)
} else {
c.recorder.Eventf(fas, corev1.EventTypeWarning, "ScalingLimited", "Scaling fleet %s was limited to minimum size of %d", fas.Spec.FleetName, desiredReplicas)
}
SaitejaTamma marked this conversation as resolved.
Show resolved Hide resolved
}

_, err := c.fleetAutoscalerGetter.FleetAutoscalers(fas.ObjectMeta.Namespace).UpdateStatus(ctx, fasCopy, metav1.UpdateOptions{})
Expand Down