Skip to content

Commit aec94c2

Browse files
committed
update stat with optimistic locking
1 parent 5dbef65 commit aec94c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sample-operators/leader-election/src/main/java/io/javaoperatorsdk/operator/sample/LeaderElectionTestReconciler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public UpdateControl<LeaderElectionTestCustomResource> reconcile(
2727
}
2828

2929
resource.getStatus().getReconciledBy().add(reconcilerName);
30-
31-
return UpdateControl.patchStatus(resource).rescheduleAfter(Duration.ofSeconds(1));
30+
// update status is with optimistic locking
31+
return UpdateControl.updateStatus(resource).rescheduleAfter(Duration.ofSeconds(1));
3232
}
3333

3434
}

0 commit comments

Comments
 (0)