Skip to content

Commit

Permalink
fix(e2e): port forward to service instead of pod of kuma-cp to improv…
Browse files Browse the repository at this point in the history
…e test stability (#11737)

* fix(ci): port forward to service instead of pod of kuma-cp to improve test stability

Signed-off-by: Marcin Skalski <[email protected]>

---------

Signed-off-by: Marcin Skalski <[email protected]>
  • Loading branch information
Automaat authored and kumahq[bot] committed Oct 9, 2024
1 parent b9b5d5d commit 5950727
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/framework/k8s_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (c *K8sControlPlane) GetKubectlOptions(namespace ...string) *k8s.KubectlOpt
}

func (c *K8sControlPlane) PortForwardKumaCP() {
<<<<<<< HEAD

Check failure on line 81 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected <<, expected }

Check failure on line 81 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

expected statement, found '<<' (typecheck)

Check failure on line 81 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected <<, expected }
kumaCpPods := c.GetKumaCPPods()
// There could be multiple pods still starting so pick one that's available already
for i := range kumaCpPods {
Expand All @@ -87,8 +88,21 @@ func (c *K8sControlPlane) PortForwardKumaCP() {
c.portFwd.ApiServerEndpoint = c.portFwd.apiServerTunnel.Endpoint()
return
}
=======

Check failure on line 91 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

expected statement, found '==' (typecheck)
kumaCpSvc := c.GetKumaCPSvc()
if k8s.IsServiceAvailable(&kumaCpSvc) {
c.portFwd.apiServerTunnel = k8s.NewTunnel(c.GetKubectlOptions(Config.KumaNamespace), k8s.ResourceTypeService, kumaCpSvc.Name, 0, 5681)
c.portFwd.apiServerTunnel.ForwardPort(c.t)
c.portFwd.ApiServerEndpoint = c.portFwd.apiServerTunnel.Endpoint()

c.madsFwd.apiServerTunnel = k8s.NewTunnel(c.GetKubectlOptions(Config.KumaNamespace), k8s.ResourceTypeService, kumaCpSvc.Name, 0, 5676)
c.madsFwd.apiServerTunnel.ForwardPort(c.t)
c.madsFwd.ApiServerEndpoint = c.madsFwd.apiServerTunnel.Endpoint()
return
>>>>>>> 7129c9496 (fix(e2e): port forward to service instead of pod of kuma-cp to improve test stability (#11737))

Check failure on line 102 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

invalid character U+0023 '#' (typecheck)

Check failure on line 102 in test/framework/k8s_controlplane.go

View workflow job for this annotation

GitHub Actions / lint

expected statement, found '>>' (typecheck)
}
c.t.Fatalf("Failed finding an available pod, allPods: %v", kumaCpPods)

c.t.Fatalf("Failed finding an available service, service: %v", kumaCpSvc)
}

func (c *K8sControlPlane) ClosePortForwards() {
Expand Down

0 comments on commit 5950727

Please sign in to comment.