e2e services test pods should wait until they are ready

This commit is contained in:
Antonio Ojea 2021-02-18 16:08:59 +01:00
parent f760c21cd1
commit 6d614c9c50

View File

@ -2454,6 +2454,8 @@ func createPodOrFail(c clientset.Interface, ns, name string, labels map[string]s
_, err := c.CoreV1().Pods(ns).Create(context.TODO(), pod, metav1.CreateOptions{})
framework.ExpectNoError(err, "failed to create pod %s in namespace %s", name, ns)
err = e2epod.WaitTimeoutForPodReadyInNamespace(c, name, ns, framework.PodStartTimeout)
framework.ExpectNoError(err)
}
// launchHostExecPod launches a hostexec pod in the given namespace and waits
@ -2463,7 +2465,7 @@ func launchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod {
hostExecPod := e2epod.NewExecPodSpec(ns, name, true)
pod, err := client.CoreV1().Pods(ns).Create(context.TODO(), hostExecPod, metav1.CreateOptions{})
framework.ExpectNoError(err)
err = e2epod.WaitForPodRunningInNamespace(client, pod)
err = e2epod.WaitTimeoutForPodReadyInNamespace(client, name, ns, framework.PodStartTimeout)
framework.ExpectNoError(err)
return pod
}