From ee085f7ae8421bfe72bc07da8305f5dd7909dd02 Mon Sep 17 00:00:00 2001 From: Alejandro Pedraza Date: Thu, 29 Oct 2020 16:38:41 -0500 Subject: [PATCH] Fix multicluster for EKS (#5159) `linkerd mc link` wasn't properly setting the `gatewayAddresses` field when such address had a `Hostname` field instead of `Ip`, like is the case in EKS services of type LoadBalancer. --- cli/cmd/multicluster.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/cmd/multicluster.go b/cli/cmd/multicluster.go index d872271f0..6b0958077 100644 --- a/cli/cmd/multicluster.go +++ b/cli/cmd/multicluster.go @@ -617,7 +617,14 @@ func newLinkCommand() *cobra.Command { gatewayAddresses := []string{} for _, ingress := range gateway.Status.LoadBalancer.Ingress { - gatewayAddresses = append(gatewayAddresses, ingress.IP) + addr := ingress.IP + if addr == "" { + addr = ingress.Hostname + } + if addr == "" { + continue + } + gatewayAddresses = append(gatewayAddresses, addr) } if len(gatewayAddresses) == 0 { return fmt.Errorf("Gateway %s.%s has no ingress addresses", gateway.Name, gateway.Namespace)