Skip to content

Commit

Permalink
E2E: Use GetHealthCheckIP in gateway status test
Browse files Browse the repository at this point in the history
...instead of checking if HealthCheckIPs is populated for backwards
compatibility if run on a Submariner installation that isn't running
a version with the updated gateway code that sets HealthCheckIPs.

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis committed Feb 1, 2025
1 parent cda7f6e commit 9535360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/e2e/dataplane/gateway_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8snet "k8s.io/utils/net"
)

var _ = Describe("Gateway status reporting", Label(TestLabel), func() {
Expand Down Expand Up @@ -110,7 +111,8 @@ func verifyGateway(gw *submarinerv1.Gateway, otherCluster string, healthCheckedE
}

if healthCheckedEnabled {
if len(gw.Status.Connections[i].Endpoint.HealthCheckIPs) == 0 {
if gw.Status.Connections[i].Endpoint.GetHealthCheckIP(k8snet.IPv4) == "" ||
gw.Status.Connections[i].Endpoint.GetHealthCheckIP(k8snet.IPv6) == "" {
return false, fmt.Sprintf("Connection for cluster %q has no health check IP. This could be because the Gateway or"+
" Globalnet pod could not determine the cluster's CNI IP address. If so, this would be reported in the pod log.",
otherCluster), nil
Expand Down

0 comments on commit 9535360

Please sign in to comment.