Use e2epod.WaitForPodNoLongerRunningInNamespace directly

WaitForPod*() are just wrapper functions for e2epod package, and they
made an invalid dependency to sub e2e framework from the core framework.
So this replaces WaitForPodNoLongerRunning() with the e2epod function.
This commit is contained in:
Kenichi Omichi 2020-03-20 21:03:44 +00:00
parent 990a3802f6
commit 12ff8f2861
2 changed files with 2 additions and 8 deletions

View File

@ -89,7 +89,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
gomega.Expect(ev).To(gomega.BeNil()) gomega.Expect(ev).To(gomega.BeNil())
ginkgo.By("Waiting for pod completion") ginkgo.By("Waiting for pod completion")
err = f.WaitForPodNoLongerRunning(pod.Name) err = e2epod.WaitForPodNoLongerRunningInNamespace(f.ClientSet, pod.Name, f.Namespace.Name)
framework.ExpectNoError(err) framework.ExpectNoError(err)
pod, err = podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{}) pod, err = podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{})
framework.ExpectNoError(err) framework.ExpectNoError(err)
@ -129,7 +129,7 @@ var _ = framework.KubeDescribe("Sysctls [LinuxOnly] [NodeFeature:Sysctls]", func
gomega.Expect(ev).To(gomega.BeNil()) gomega.Expect(ev).To(gomega.BeNil())
ginkgo.By("Waiting for pod completion") ginkgo.By("Waiting for pod completion")
err = f.WaitForPodNoLongerRunning(pod.Name) err = e2epod.WaitForPodNoLongerRunningInNamespace(f.ClientSet, pod.Name, f.Namespace.Name)
framework.ExpectNoError(err) framework.ExpectNoError(err)
pod, err = podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{}) pod, err = podClient.Get(context.TODO(), pod.Name, metav1.GetOptions{})
framework.ExpectNoError(err) framework.ExpectNoError(err)

View File

@ -539,12 +539,6 @@ func (f *Framework) WaitForPodRunningSlow(podName string) error {
return e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, podName, f.Namespace.Name) return e2epod.WaitForPodRunningInNamespaceSlow(f.ClientSet, podName, f.Namespace.Name)
} }
// WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either
// success or failure.
func (f *Framework) WaitForPodNoLongerRunning(podName string) error {
return e2epod.WaitForPodNoLongerRunningInNamespace(f.ClientSet, podName, f.Namespace.Name)
}
// ClientConfig an externally accessible method for reading the kube client config. // ClientConfig an externally accessible method for reading the kube client config.
func (f *Framework) ClientConfig() *rest.Config { func (f *Framework) ClientConfig() *rest.Config {
ret := rest.CopyConfig(f.clientConfig) ret := rest.CopyConfig(f.clientConfig)