Skip to content

Commit

Permalink
Fix resign method to use getObservedRecord with mutex lock
Browse files Browse the repository at this point in the history
  • Loading branch information
osmman committed Feb 10, 2025
1 parent d81f1dc commit e408bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/election2/k8s/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (e *Election) Resign(ctx context.Context) error {

now := metav1.NewTime(e.clock.Now())
leaderElectionRecord := resourcelock.LeaderElectionRecord{
LeaderTransitions: e.observedRecord.LeaderTransitions,
LeaderTransitions: e.getObservedRecord().LeaderTransitions,
LeaseDurationSeconds: 1,
RenewTime: now,
AcquireTime: now,
Expand Down

0 comments on commit e408bf5

Please sign in to comment.