Skip to content

Commit

Permalink
treat ipv6 case
Browse files Browse the repository at this point in the history
Signed-off-by: Guy Daich <[email protected]>
  • Loading branch information
guydc committed Dec 18, 2024
1 parent 9c83c5e commit 60a7961
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/tests/certificate_rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ var CertificateRotationTest = suite.ConformanceTest{
EnvoyGatewayLBSVC := "envoy-gateway-ext-lb"
EnvoyCertificateSecret := "envoy"
EnvoyGatewayXDSPort := 18000
var envoyGatewayAddr string

ctx := context.Background()
envoyGatewaySvc := &corev1.Service{}
err := suite.Client.Get(ctx, types.NamespacedName{Namespace: envoyGatewayNS, Name: EnvoyGatewayLBSVC}, envoyGatewaySvc)
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}
Expand Down

0 comments on commit 60a7961

Please sign in to comment.