Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Check and report the error return from getKubePeers() #3582

Merged
merged 1 commit into from
Jan 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions prog/kube-utils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func reclaimRemovedPeers(kube kubernetes.Interface, cml *configMapAnnotations, m
return err
}
nodes, err := getKubePeers(kube, true)
if err != nil {
return err
}
nodeSet := make(map[string]struct{}, len(nodes))
for _, node := range nodes {
nodeSet[node.name] = struct{}{}
Expand Down Expand Up @@ -294,9 +297,6 @@ func main() {
}
return
}
if err != nil {
common.Log.Fatalf("[kube-peers] Could not get peers: %v", err)
}
if justReclaim {
cml := newConfigMapAnnotations(configMapNamespace, configMapName, c)

Expand All @@ -313,6 +313,9 @@ func main() {
return
}
peers, err := getKubePeers(c, false)
if err != nil {
common.Log.Fatalf("[kube-peers] Could not get peers: %v", err)
}
for _, node := range peers {
fmt.Println(node.addr)
}
Expand Down