mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
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:
commit
e190fec59e
@ -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 {
|
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) {
|
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user