From af96de61849b85f5d41653a32fb2ac274d4be227 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 28 Jun 2022 13:50:07 +0900 Subject: [PATCH] Fix completed runner pod recreation not to be blocked after max out (#1568) 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 5ebc12f5..4c3aaad5 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