Merge pull request #84090 from oomichi/move-LaunchHostExecPod

Move LaunchHostExecPod() to e2e network
This commit is contained in:
Kubernetes Prow Robot 2019-10-20 17:47:37 -07:00 committed by GitHub
commit ba4adeff20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -442,17 +442,6 @@ func NewExecPodSpec(ns, name string, hostNetwork bool) *v1.Pod {
return pod
}
// LaunchHostExecPod launches a hostexec pod in the given namespace and waits
// until it's Running
func LaunchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod {
hostExecPod := NewExecPodSpec(ns, name, true)
pod, err := client.CoreV1().Pods(ns).Create(hostExecPod)
expectNoError(err)
err = WaitForPodRunningInNamespace(client, pod)
expectNoError(err)
return pod
}
// newExecPodSpec returns the pod spec of exec pod
func newExecPodSpec(ns, generateName string) *v1.Pod {
immediate := int64(0)

View File

@ -1318,7 +1318,7 @@ var _ = SIGDescribe("Services", func() {
err = t.DeleteService(serviceName)
framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns)
hostExec := e2epod.LaunchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec")
hostExec := launchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec")
cmd := fmt.Sprintf(`! ss -ant46 'sport = :%d' | tail -n +2 | grep LISTEN`, nodePort)
var stdout string
if pollErr := wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) {
@ -1624,7 +1624,7 @@ var _ = SIGDescribe("Services", func() {
// a pod to test the service.
ginkgo.By("hitting the internal load balancer from pod")
framework.Logf("creating pod with host network")
hostExec := e2epod.LaunchHostExecPod(f.ClientSet, f.Namespace.Name, "ilb-host-exec")
hostExec := launchHostExecPod(f.ClientSet, f.Namespace.Name, "ilb-host-exec")
framework.Logf("Waiting up to %v for service %q's internal LB to respond to requests", createTimeout, serviceName)
tcpIngressIP := e2eservice.GetIngressPoint(lbIngress)
@ -2581,3 +2581,14 @@ func createPausePodDeployment(cs clientset.Interface, name, ns string, replicas
framework.ExpectNoError(err, "Error in creating deployment for pause pod")
return deployment
}
// launchHostExecPod launches a hostexec pod in the given namespace and waits
// until it's Running
func launchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod {
hostExecPod := e2epod.NewExecPodSpec(ns, name, true)
pod, err := client.CoreV1().Pods(ns).Create(hostExecPod)
framework.ExpectNoError(err)
err = e2epod.WaitForPodRunningInNamespace(client, pod)
framework.ExpectNoError(err)
return pod
}