From 3eb165927dd579290502bf938c53a74f5b3e01db Mon Sep 17 00:00:00 2001 From: chenyaqi01 Date: Fri, 27 Sep 2019 10:06:50 +0800 Subject: [PATCH] replace bytes.Compare() with bytes.Equal() Kubernetes-commit: 66be69bb0e7fd147be650385d272ae14ee2857c8 --- tools/leaderelection/leaderelection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index 4e6d3ecd..42fffd45 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -341,7 +341,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { } // 2. Record obtained, check the Identity & Time - if bytes.Compare(le.observedRawRecord, oldLeaderElectionRawRecord) != 0 { + if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { le.observedRecord = *oldLeaderElectionRecord le.observedRawRecord = oldLeaderElectionRawRecord le.observedTime = le.clock.Now()