addressing review comments
This commit is contained in:
1 parent
7a959df648
commit
59c1abe9b9
2 files changed
+4
-8
No files matched your search
@@ -140,14 +140,10 @@ func reclaimPeer(weave weaveClient, cml *configMapAnnotations, storedPeerList *p
|
|||||||
} else {
|
} else {
|
||||||
// handle an edge case where peer claimed to own the action to reclaim but no longer
|
// handle an edge case where peer claimed to own the action to reclaim but no longer
|
||||||
// exists hence lock persists foever
|
// exists hence lock persists foever
|
||||||
peerExists := false
|
if !storedPeerList.contains(existingAnnotation) {
|
||||||
for _, peer := range storedPeerList.Peers {
|
nonExistentPeer = true
|
||||||
if existingAnnotation == peer.PeerName {
|
common.Log.Debugln("[kube-peers] Existing annotation", existingAnnotation, " has a non-existent peer so owning the reclaim action")
|
||||||
peerExists = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
nonExistentPeer = !peerExists
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found || nonExistentPeer {
|
if !found || nonExistentPeer {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ type peerInfo struct {
|
|||||||
NodeName string // Kubernetes node name
|
NodeName string // Kubernetes node name
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pl peerList) contains(peerName string) bool {
|
func (pl *peerList) contains(peerName string) bool {
|
||||||
for _, peer := range pl.Peers {
|
for _, peer := range pl.Peers {
|
||||||
if peer.PeerName == peerName {
|
if peer.PeerName == peerName {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in new issue
Block a user