Add debugging message to know the pod status

The log of a flake test says
"Pod did not start running: timed out waiting for the condition"
but it is hard to know what is actual status of the pod.
So this adds debugging message to know that.
This commit is contained in:
Kenichi Omichi 2019-12-30 19:38:40 +00:00
parent a1364be012
commit 99c2e74a23

View File

@ -184,10 +184,13 @@ func podRunningAndReady(c clientset.Interface, podName, namespace string) wait.C
}
switch pod.Status.Phase {
case v1.PodFailed, v1.PodSucceeded:
e2elog.Logf("The status of Pod %s is %s which is unexpected", podName, pod.Status.Phase)
return false, conditions.ErrPodCompleted
case v1.PodRunning:
e2elog.Logf("The status of Pod %s is %s (Ready = %v)", podName, pod.Status.Phase, podutil.IsPodReady(pod))
return podutil.IsPodReady(pod), nil
}
e2elog.Logf("The status of Pod %s is %s, waiting for it to be Running (with Ready = true)", podName, pod.Status.Phase)
return false, nil
}
}