Merge pull request #35128 from wongma7/wait-restartpolicy

Automatic merge from submit-queue

Set done to true & return error if RestartPolicy not Always in test framework

Found a small issue with https://github.com/kubernetes/kubernetes/pull/34632, it returns an error if the RestartPolicy is not Always, but the user will never see it because done isn't set to true & they will timeout instead.

@Random-Liu because you wrote that PR
This commit is contained in:
Kubernetes Submit Queue 2016-10-27 01:27:56 -07:00 committed by GitHub
commit e190fec59e

View File

@ -1314,7 +1314,7 @@ func waitForPodTerminatedInNamespace(c clientset.Interface, podName, reason, nam
func waitForPodSuccessInNamespaceTimeout(c clientset.Interface, podName string, namespace string, timeout time.Duration) error {
return waitForPodCondition(c, namespace, podName, "success or failure", timeout, func(pod *api.Pod) (bool, error) {
if pod.Spec.RestartPolicy == api.RestartPolicyAlways {
return false, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName)
return true, fmt.Errorf("pod %q will never terminate with a succeeded state since its restart policy is Always", podName)
}
switch pod.Status.Phase {
case api.PodSucceeded: