Only look at IP addresses on pods that haven't finished

This commit is contained in:
Bryan Boreham committed 2016-11-22 13:49:28 +00:00
1 parent 49e76d1486
commit 4219c2c2ab
1 file changed
+3 -2
+3 -2
View File
@@ -302,8 +302,9 @@ func (ns *ns) deleteNamespace(obj *coreapi.Namespace) error {
}
func hasIP(pod *coreapi.Pod) bool {
// Ensure pod has an IP address and isn't sharing the host network namespace
return len(pod.Status.PodIP) > 0 && !pod.Spec.HostNetwork
// Ensure pod isn't dead, has an IP address and isn't sharing the host network namespace
return pod.Status.Phase != "Succeeded" && pod.Status.Phase != "Failed" &&
len(pod.Status.PodIP) > 0 && !pod.Spec.HostNetwork
}
func equals(a, b map[string]string) bool {