mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-14 05:25:33 +00:00
chore
Kubernetes-commit: 09ec6f744833fb72a319013ae25cf0286cdd125e
This commit is contained in:
parent
b62c1cc29f
commit
3633ea23d3
@ -308,8 +308,8 @@ func (le *LeaderElector) renew(ctx context.Context) {
|
||||
func (le *LeaderElector) release() bool {
|
||||
ctx := context.Background()
|
||||
|
||||
// 1. obtain the electionRecord
|
||||
oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx)
|
||||
// update the resourceVersion of lease
|
||||
oldLeaderElectionRecord, _, err := le.config.Lock.Get(ctx)
|
||||
if err != nil {
|
||||
if !errors.IsNotFound(err) {
|
||||
klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err)
|
||||
@ -318,12 +318,6 @@ func (le *LeaderElector) release() bool {
|
||||
klog.Infof("lease lock not found: %v", le.config.Lock.Describe())
|
||||
return false
|
||||
}
|
||||
// 2. Record obtained, check the Identity & Time
|
||||
if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) {
|
||||
le.setObservedRecord(oldLeaderElectionRecord)
|
||||
|
||||
le.observedRawRecord = oldLeaderElectionRawRecord
|
||||
}
|
||||
|
||||
if !le.IsLeader() {
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user