Skip to content

Commit ba4adef

Browse files
authored
Merge pull request kubernetes#84090 from oomichi/move-LaunchHostExecPod
Move LaunchHostExecPod() to e2e network
2 parents ffc2227 + 5285cf3 commit ba4adef

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

test/e2e/framework/pod/resource.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,6 @@ func NewExecPodSpec(ns, name string, hostNetwork bool) *v1.Pod {
442442
return pod
443443
}
444444

445-
// LaunchHostExecPod launches a hostexec pod in the given namespace and waits
446-
// until it's Running
447-
func LaunchHostExecPod(client clientset.Interface, ns, name string) *v1.Pod {
448-
hostExecPod := NewExecPodSpec(ns, name, true)
449-
pod, err := client.CoreV1().Pods(ns).Create(hostExecPod)
450-
expectNoError(err)
451-
err = WaitForPodRunningInNamespace(client, pod)
452-
expectNoError(err)
453-
return pod
454-
}
455-
456445
// newExecPodSpec returns the pod spec of exec pod
457446
func newExecPodSpec(ns, generateName string) *v1.Pod {
458447
immediate := int64(0)

test/e2e/network/service.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ var _ = SIGDescribe("Services", func() {
13181318
err = t.DeleteService(serviceName)
13191319
framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns)
13201320

1321-
hostExec := e2epod.LaunchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec")
1321+
hostExec := launchHostExecPod(f.ClientSet, f.Namespace.Name, "hostexec")
13221322
cmd := fmt.Sprintf(`! ss -ant46 'sport = :%d' | tail -n +2 | grep LISTEN`, nodePort)
13231323
var stdout string
13241324
if pollErr := wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) {
@@ -1624,7 +1624,7 @@ var _ = SIGDescribe("Services", func() {
16241624
// a pod to test the service.
16251625
ginkgo.By("hitting the internal load balancer from pod")
16261626
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")
16281628

16291629
framework.Logf("Waiting up to %v for service %q's internal LB to respond to requests", createTimeout, serviceName)
16301630
tcpIngressIP := e2eservice.GetIngressPoint(lbIngress)
@@ -2581,3 +2581,14 @@ func createPausePodDeployment(cs clientset.Interface, name, ns string, replicas
25812581
framework.ExpectNoError(err, "Error in creating deployment for pause pod")
25822582
return deployment
25832583
}
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

Comments
 (0)