Fix ephemeral runner set status update

This commit is contained in:
Nikola Jokic
2026-06-12 17:10:10 +02:00
parent 767e58e4b1
commit 1435f1d366
10 changed files with 25 additions and 3 deletions
@@ -271,7 +271,6 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R
}
func (r *EphemeralRunnerSetReconciler) updateStatus(ctx context.Context, ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet, state *ephemeralRunnersByState, log logr.Logger) error {
original := ephemeralRunnerSet.DeepCopy()
total := state.scaleTotal()
var phase v1alpha1.EphemeralRunnerSetPhase
switch {
@@ -293,7 +292,7 @@ func (r *EphemeralRunnerSetReconciler) updateStatus(ctx context.Context, ephemer
// Update the status if needed.
if ephemeralRunnerSet.Status != desiredStatus {
ephemeralRunnerSet.Status = desiredStatus
if err := r.Status().Patch(ctx, ephemeralRunnerSet, client.MergeFrom(original)); err != nil {
if err := r.Status().Update(ctx, ephemeralRunnerSet); err != nil {
log.Error(err, "Failed to update EphemeralRunnerSet status")
return err
}