diff --git a/npc/namespace.go b/npc/namespace.go index 3974bf3a..e3edb6dc 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 {