Set done to true & return error if RestartPolicy not Always

pull/6/head
Matthew Wong 2016-10-19 11:34:05 -04:00
parent be1996ee64
commit 28f1d48bb4
1 changed files with 1 additions and 1 deletions

View File

@ -1313,7 +1313,7 @@ func waitForPodTerminatedInNamespace(c *client.Client, podName, reason, namespac
func waitForPodSuccessInNamespaceTimeout(c *client.Client, 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: