From 15b9b7416a19e0e9a9a4830901b71f55326c9333 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 26 Mar 2019 17:25:34 +0000 Subject: [PATCH] Re-read peers ConfigMap from Kubernetes at start of every reclaim A previous reclaim may have left the map set to nil. --- prog/kube-utils/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prog/kube-utils/main.go b/prog/kube-utils/main.go index e0403f76..691d4c88 100644 --- a/prog/kube-utils/main.go +++ b/prog/kube-utils/main.go @@ -140,6 +140,11 @@ func reclaimPeer(weave weaveClient, cml *configMapAnnotations, storedPeerList *p okToRemove := false nonExistentPeer := false + // Re-read status from Kubernetes; speculative updates may leave it un-set + if err := cml.Init(); err != nil { + return false, err + } + // 3. Check if there is an existing annotation with key X existingAnnotation, found := cml.GetAnnotation(KubePeersPrefix + peerName) if found {