diff --git a/controllers/autoscaling.go b/controllers/autoscaling.go index a9bfdb78..84ba56f1 100644 --- a/controllers/autoscaling.go +++ b/controllers/autoscaling.go @@ -29,10 +29,8 @@ func (r *HorizontalRunnerAutoscalerReconciler) suggestDesiredReplicas(st scaleTa metrics := hra.Spec.Metrics numMetrics := len(metrics) if numMetrics == 0 { - if len(hra.Spec.ScaleUpTriggers) == 0 { - return r.suggestReplicasByQueuedAndInProgressWorkflowRuns(st, hra, nil) - } - + // We don't default to anything since ARC 0.23.0 + // See https://github.com/actions-runner-controller/actions-runner-controller/issues/728 return nil, nil } else if numMetrics > 2 { return nil, fmt.Errorf("too many autoscaling metrics configured: It must be 0 to 2, but got %d", numMetrics) diff --git a/controllers/autoscaling_test.go b/controllers/autoscaling_test.go index 01b8b351..4bf9f7e1 100644 --- a/controllers/autoscaling_test.go +++ b/controllers/autoscaling_test.go @@ -221,6 +221,11 @@ func TestDetermineDesiredReplicas_RepositoryRunner(t *testing.T) { Spec: v1alpha1.HorizontalRunnerAutoscalerSpec{ MaxReplicas: tc.max, MinReplicas: tc.min, + Metrics: []v1alpha1.MetricSpec{ + { + Type: "TotalNumberOfQueuedAndInProgressWorkflowRuns", + }, + }, }, Status: v1alpha1.HorizontalRunnerAutoscalerStatus{ DesiredReplicas: tc.sReplicas,