addressing review comments

This commit is contained in:
Murali Reddy committed 2018-10-04 14:08:56 +05:30
1 parent 7a959df648
commit 59c1abe9b9
2 files changed
+4 -8

No files matched your search

+3 -7
View File
@@ -140,14 +140,10 @@ func reclaimPeer(weave weaveClient, cml *configMapAnnotations, storedPeerList *p
} else {
// handle an edge case where peer claimed to own the action to reclaim but no longer
// exists hence lock persists foever
peerExists := false
for _, peer := range storedPeerList.Peers {
if existingAnnotation == peer.PeerName {
peerExists = true
break
}
if !storedPeerList.contains(existingAnnotation) {
nonExistentPeer = true
common.Log.Debugln("[kube-peers] Existing annotation", existingAnnotation, " has a non-existent peer so owning the reclaim action")
}
nonExistentPeer = !peerExists
}
}
if !found || nonExistentPeer {
+1 -1
View File
@@ -26,7 +26,7 @@ type peerInfo struct {
NodeName string // Kubernetes node name
}
func (pl peerList) contains(peerName string) bool {
func (pl *peerList) contains(peerName string) bool {
for _, peer := range pl.Peers {
if peer.PeerName == peerName {
return true