From e69d9e3c71a325972922ae6b640cef29c4237f9f Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Fri, 11 Sep 2026 09:03:36 +0200 Subject: [PATCH] Move deletion of terminated runners after patch update Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../actions.github.com/ephemeralrunnerset_controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/actions.github.com/ephemeralrunnerset_controller.go b/controllers/actions.github.com/ephemeralrunnerset_controller.go index 2fc505f8..34ce10ed 100644 --- a/controllers/actions.github.com/ephemeralrunnerset_controller.go +++ b/controllers/actions.github.com/ephemeralrunnerset_controller.go @@ -217,14 +217,14 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R // patch ID the cleanup belongs to and return, leaving the scaling decision // to the next reconcile, which sees the post-cleanup state. if len(ephemeralRunnersByState.finished) > 0 { - if err := r.deleteTerminatedEphemeralRunners(ctx, ephemeralRunnersByState.finished, log); err != nil { - log.Error(err, "failed to delete terminated ephemeral runners") - return ctrl.Result{}, err - } if err := r.patchFinishedRunnerCleanupPatchIDStatus(ctx, req.NamespacedName, ephemeralRunnerSet.Spec.PatchID); err != nil { log.Error(err, "failed to update finished runner cleanup patch ID status") return ctrl.Result{}, err } + if err := r.deleteTerminatedEphemeralRunners(ctx, ephemeralRunnersByState.finished, log); err != nil { + log.Error(err, "failed to delete terminated ephemeral runners") + return ctrl.Result{}, err + } ephemeralRunnerSet.Status.FinishedRunnerCleanupPatchID = ephemeralRunnerSet.Spec.PatchID log.Info("Finished ephemeral runners were cleaned up, deferring scaling decision")