From 15ee6d63601098e607bc0c366a5d2f60dd7f9ec7 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 8 Mar 2022 10:29:53 +0900 Subject: [PATCH] chore: Reorganize "Calculated desired replicas log fields (#1190) So that `max` is emitted immediately after `min`, which is the counterpart of it. --- controllers/horizontalrunnerautoscaler_controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/horizontalrunnerautoscaler_controller.go b/controllers/horizontalrunnerautoscaler_controller.go index 625bd681..f6f09b0c 100644 --- a/controllers/horizontalrunnerautoscaler_controller.go +++ b/controllers/horizontalrunnerautoscaler_controller.go @@ -572,6 +572,10 @@ func (r *HorizontalRunnerAutoscalerReconciler) computeReplicasWithCache(log logr "min", minReplicas, } + if maxReplicas := hra.Spec.MaxReplicas; maxReplicas != nil { + kvs = append(kvs, "max", *maxReplicas) + } + if cached != nil { kvs = append(kvs, "cached", *cached) } @@ -581,10 +585,6 @@ func (r *HorizontalRunnerAutoscalerReconciler) computeReplicasWithCache(log logr kvs = append(kvs, "scale_down_delay_until", scaleDownDelayUntil) } - if maxReplicas := hra.Spec.MaxReplicas; maxReplicas != nil { - kvs = append(kvs, "max", *maxReplicas) - } - log.V(1).Info(fmt.Sprintf("Calculated desired replicas of %d", newDesiredReplicas), kvs..., )