Commit 1f186fc6 authored by jeff vance's avatar jeff vance

improve detectability of deleted pods

parent 427dfd5c
...@@ -1359,14 +1359,14 @@ func podNotPending(c clientset.Interface, podName, namespace string) wait.Condit ...@@ -1359,14 +1359,14 @@ func podNotPending(c clientset.Interface, podName, namespace string) wait.Condit
// to terminate or if the pod terminated with an unexpected reason. // to terminate or if the pod terminated with an unexpected reason.
func waitForPodTerminatedInNamespace(c clientset.Interface, podName, reason, namespace string) error { func waitForPodTerminatedInNamespace(c clientset.Interface, podName, reason, namespace string) error {
return WaitForPodCondition(c, namespace, podName, "terminated due to deadline exceeded", PodStartTimeout, func(pod *v1.Pod) (bool, error) { return WaitForPodCondition(c, namespace, podName, "terminated due to deadline exceeded", PodStartTimeout, func(pod *v1.Pod) (bool, error) {
if pod.Status.Phase == v1.PodFailed { if pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed {
if pod.Status.Reason == reason { if reason == "" ||
strings.ToLower(strings.TrimSpace(pod.Status.Reason)) == strings.ToLower(strings.TrimSpace(reason)) {
return true, nil return true, nil
} else { } else {
return true, fmt.Errorf("Expected pod %v in namespace %v to be terminated with reason %v, got reason: %v", podName, namespace, reason, pod.Status.Reason) return true, fmt.Errorf("Expected pod %q in namespace %q to be terminated with reason %q, got reason: %q", podName, namespace, reason, pod.Status.Reason)
} }
} }
return false, nil return false, nil
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment