mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-03 06:02:25 +02:00
HandleJobStarted reads the ephemeral runner to decide whether the runner is still eligible for the Running phase, then applies that decision with a separate merge patch. The patch carried no precondition, so nothing tied it to the state the decision was made on: if the ephemeral runner controller wrote a terminal phase in between, the listener silently overwrote it and resurrected a runner that had already finished. Attach the observed resourceVersion to the patch whenever the phase is transitioned, and retry on conflict so the decision is re-made against the fresh state. The job detail fields stay unguarded: they are write-once metadata that the runner set only consults for runners that are neither done nor being deleted, so patching them cannot change a scaling decision. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>