From 906f2b9ea1fe91a46c9b880fe631bcc2536078eb Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Mon, 27 Jun 2022 11:42:47 +0000 Subject: [PATCH] Fix completed runner pod recreation not to be blocked after max out Ref https://github.com/actions-runner-controller/actions-runner-controller/pull/1477#issuecomment-1164154496 --- controllers/runnerdeployment_controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/runnerdeployment_controller.go b/controllers/runnerdeployment_controller.go index 5ebc12f576..4c3aaad542 100644 --- a/controllers/runnerdeployment_controller.go +++ b/controllers/runnerdeployment_controller.go @@ -179,7 +179,10 @@ func (r *RunnerDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req newDesiredReplicas := getIntOrDefault(desiredRS.Spec.Replicas, defaultReplicas) // Please add more conditions that we can in-place update the newest runnerreplicaset without disruption - if currentDesiredReplicas != newDesiredReplicas { + // + // If we missed taking the EffectiveTime diff into account, you might end up experiencing scale-ups being delayed scale-down. + // See https://github.com/actions-runner-controller/actions-runner-controller/pull/1477#issuecomment-1164154496 + if currentDesiredReplicas != newDesiredReplicas || newestSet.Spec.EffectiveTime != rd.Spec.EffectiveTime { newestSet.Spec.Replicas = &newDesiredReplicas newestSet.Spec.EffectiveTime = rd.Spec.EffectiveTime