render: Don't return blank addresses for pods

A small performance improvement - instead of creating an entry in a
map which doesn't match anything, just skip a pod with a blank IP.
This commit is contained in:
Bryan Boreham
2018-05-29 15:30:15 +00:00
parent 6ded4953bb
commit fe28febbe1
+1 -1
View File
@@ -116,7 +116,7 @@ func MapPod2IP(m report.Node) []string {
}
ip, ok := m.Latest.Lookup(kubernetes.IP)
if !ok {
if !ok || ip == "" {
return nil
}
return []string{report.MakeScopedEndpointNodeID("", ip, "")}