mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 12:17:52 +00:00
replace bytes.Compare() with bytes.Equal()
This commit is contained in:
@@ -216,7 +216,7 @@ func (e *CombinedEtcdClient) AttachLease(leaseDuration time.Duration) error {
|
||||
if err != nil {
|
||||
klog.Errorf("Error while attaching lease to: %s", string(kv.Key))
|
||||
}
|
||||
if bytes.Compare(putResp.PrevKv.Value, kv.Value) != 0 {
|
||||
if !bytes.Equal(putResp.PrevKv.Value, kv.Value) {
|
||||
return fmt.Errorf("concurrent access to key detected when setting lease on %s, expected previous value of %s but got %s",
|
||||
kv.Key, kv.Value, putResp.PrevKv.Value)
|
||||
}
|
||||
|
Reference in New Issue
Block a user