From 4219c2c2ab155c298ad27f58c7158765795b8f0f Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 21 Nov 2016 11:42:51 +0000 Subject: [PATCH] Only look at IP addresses on pods that haven't finished --- npc/namespace.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/npc/namespace.go b/npc/namespace.go index b2ae88d4..570ab7b1 100644 --- a/npc/namespace.go +++ b/npc/namespace.go @@ -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 {