Skip to content

Commit

Permalink
fix(e2e) get kds address for k8s fix (#2574)
Browse files Browse the repository at this point in the history
it was wrong, as with just UseLoadBalancer set it was ignored
and the local port of kuma-cp used instead, which broke e2e tests
on AKS

Signed-off-by: Bart Smykla <bartek@smykla.com>
  • Loading branch information
bartsmykla committed Aug 18, 2021
1 parent a931218 commit 19f4803
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/framework/k8s_controlplane.go
Expand Up @@ -226,16 +226,13 @@ func (c *K8sControlPlane) GetKDSServerAddress() string {
// As EKS and AWS generally returns dns records of load balancers instead of
// IP addresses, accessing this data (hostname) was only tested there,
// so the env var was created for that purpose
if UseLoadBalancer() && UseHostnameInsteadOfIP() {
if UseLoadBalancer() {
svc := c.GetKumaCPSvcs()[0]

ip, hostname := svc.Status.LoadBalancer.Ingress[0].IP, svc.Status.LoadBalancer.Ingress[0].Hostname
var address string
address := svc.Status.LoadBalancer.Ingress[0].IP

if ip != "" {
address = ip
} else if hostname != "" {
address = hostname
if UseHostnameInsteadOfIP() {
address = svc.Status.LoadBalancer.Ingress[0].Hostname
}

return "grpcs://" + address + ":" + strconv.FormatUint(loadBalancerKdsPort, 10)
Expand Down

0 comments on commit 19f4803

Please sign in to comment.