From 60a7961039d4c5898cd70e4c8cc4579716598877 Mon Sep 17 00:00:00 2001 From: Guy Daich Date: Tue, 17 Dec 2024 18:49:12 -0600 Subject: [PATCH] treat ipv6 case Signed-off-by: Guy Daich --- test/e2e/tests/certificate_rotation.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/tests/certificate_rotation.go b/test/e2e/tests/certificate_rotation.go index 9fed6a75541..038bec29d73 100644 --- a/test/e2e/tests/certificate_rotation.go +++ b/test/e2e/tests/certificate_rotation.go @@ -45,6 +45,7 @@ var CertificateRotationTest = suite.ConformanceTest{ EnvoyGatewayLBSVC := "envoy-gateway-ext-lb" EnvoyCertificateSecret := "envoy" EnvoyGatewayXDSPort := 18000 + var envoyGatewayAddr string ctx := context.Background() envoyGatewaySvc := &corev1.Service{} @@ -52,7 +53,12 @@ var CertificateRotationTest = suite.ConformanceTest{ require.NoError(t, err) require.Len(t, envoyGatewaySvc.Status.LoadBalancer.Ingress, 1) require.NotEmpty(t, envoyGatewaySvc.Status.LoadBalancer.Ingress[0].IP) - envoyGatewayAddr := fmt.Sprintf("%s:%d", envoyGatewaySvc.Status.LoadBalancer.Ingress[0].IP, EnvoyGatewayXDSPort) + + if IPFamily == "ipv6" { + envoyGatewayAddr = fmt.Sprintf("[%s]:%d", envoyGatewaySvc.Status.LoadBalancer.Ingress[0].IP, EnvoyGatewayXDSPort) + } else { + envoyGatewayAddr = fmt.Sprintf("%s:%d", envoyGatewaySvc.Status.LoadBalancer.Ingress[0].IP, EnvoyGatewayXDSPort) + } // get the current envoy TLS credentials certNN := types.NamespacedName{Namespace: envoyGatewayNS, Name: EnvoyCertificateSecret}