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