Skip to content

Commit

Permalink
Do patch runner status instead of update to reduce conflicts and avoi…
Browse files Browse the repository at this point in the history
…d future bugs

Ref actions#398 (comment)
  • Loading branch information
mumoshu committed Mar 18, 2021
1 parent 7a7086e commit 3cccca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func (r *RunnerReconciler) updateRegistrationToken(ctx context.Context, runner v
ExpiresAt: metav1.NewTime(rt.GetExpiresAt().Time),
}

if err := r.Status().Update(ctx, updated); err != nil {
if err := r.Status().Patch(ctx, updated, client.MergeFrom(&runner)); err != nil {
log.Error(err, "Failed to update runner status for Registration")
return false, err
}
Expand Down

0 comments on commit 3cccca8

Please sign in to comment.