Skip to content

Commit

Permalink
move conter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjumani committed Jun 17, 2024
1 parent 6dae462 commit df0683a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/bootstrap/leaderelector/kube/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func (f *kubeElectionFactory) StartElection(ctx context.Context, config *leadere
return identity, err
}

var counter atomic.Uint32
var justFailed = false
var dontDie func()

Expand Down Expand Up @@ -149,6 +148,8 @@ func (f *kubeElectionFactory) StartElection(ctx context.Context, config *leadere
// It runs within an infinite loop so that we can recover if this container is a leader but fails to renew the lease and renegotiate leader election if possible.
// This can be caused when there is a failure to connect to the kube api server
go func() {
var counter atomic.Uint32

for {
l, _ := newLeaderElector()
// Start the leader elector process
Expand Down

0 comments on commit df0683a

Please sign in to comment.