@@ -1310,7 +1310,7 @@ var _ = SIGDescribe("Services", func() {
1310
1310
err = t .DeleteService (serviceName )
1311
1311
framework .ExpectNoError (err , "failed to delete service: %s in namespace: %s" , serviceName , ns )
1312
1312
1313
- hostExec := e2epod . LaunchHostExecPod (f .ClientSet , f .Namespace .Name , "hostexec" )
1313
+ hostExec := launchHostExecPod (f .ClientSet , f .Namespace .Name , "hostexec" )
1314
1314
cmd := fmt .Sprintf (`! ss -ant46 'sport = :%d' | tail -n +2 | grep LISTEN` , nodePort )
1315
1315
var stdout string
1316
1316
if pollErr := wait .PollImmediate (framework .Poll , e2eservice .KubeProxyLagTimeout , func () (bool , error ) {
@@ -1610,7 +1610,7 @@ var _ = SIGDescribe("Services", func() {
1610
1610
// a pod to test the service.
1611
1611
ginkgo .By ("hitting the internal load balancer from pod" )
1612
1612
framework .Logf ("creating pod with host network" )
1613
- hostExec := e2epod . LaunchHostExecPod (f .ClientSet , f .Namespace .Name , "ilb-host-exec" )
1613
+ hostExec := launchHostExecPod (f .ClientSet , f .Namespace .Name , "ilb-host-exec" )
1614
1614
1615
1615
framework .Logf ("Waiting up to %v for service %q's internal LB to respond to requests" , createTimeout , serviceName )
1616
1616
tcpIngressIP := e2eservice .GetIngressPoint (lbIngress )
@@ -2545,3 +2545,14 @@ func createPausePodDeployment(cs clientset.Interface, name, ns string, replicas
2545
2545
framework .ExpectNoError (err , "Error in creating deployment for pause pod" )
2546
2546
return deployment
2547
2547
}
2548
+
2549
+ // launchHostExecPod launches a hostexec pod in the given namespace and waits
2550
+ // until it's Running
2551
+ func launchHostExecPod (client clientset.Interface , ns , name string ) * v1.Pod {
2552
+ hostExecPod := e2epod .NewExecPodSpec (ns , name , true )
2553
+ pod , err := client .CoreV1 ().Pods (ns ).Create (hostExecPod )
2554
+ framework .ExpectNoError (err )
2555
+ err = e2epod .WaitForPodRunningInNamespace (client , pod )
2556
+ framework .ExpectNoError (err )
2557
+ return pod
2558
+ }
0 commit comments