Commit 28f1d48b authored by Matthew Wong's avatar Matthew Wong

Set done to true & return error if RestartPolicy not Always

parent be1996ee
...@@ -1313,7 +1313,7 @@ func waitForPodTerminatedInNamespace(c *client.Client, podName, reason, namespac ...@@ -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 { 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) { return waitForPodCondition(c, namespace, podName, "success or failure", timeout, func(pod *api.Pod) (bool, error) {
if pod.Spec.RestartPolicy == api.RestartPolicyAlways { 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 { switch pod.Status.Phase {
case api.PodSucceeded: case api.PodSucceeded:
......
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