Skip to content

Commit

Permalink
Take the externalDns hostname into account (#358)
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha authored Jan 31, 2025
1 parent b6b9cd4 commit da7186c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/registry/meta/gatewayinfo/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,17 @@ func (r *Storage) Get(ctx context.Context, name string, options *metav1.GetOptio
for _, s := range svcList.Items {
if s.Labels[meta.ManagedByLabelKey] == "envoy-gateway" && s.Labels[OwningGatewayClassLabel] == class.Name {
svcType = string(s.Spec.Type)
if s.Status.LoadBalancer.Ingress != nil {
ip = s.Status.LoadBalancer.Ingress[0].IP
hostName = s.Status.LoadBalancer.Ingress[0].Hostname

val, ok := s.Annotations["external-dns.alpha.kubernetes.io/hostname"]
if ok {
hostName = val
} else {
if s.Status.LoadBalancer.Ingress != nil {
ip = s.Status.LoadBalancer.Ingress[0].IP
hostName = s.Status.LoadBalancer.Ingress[0].Hostname
}
}

}
}

Expand Down

0 comments on commit da7186c

Please sign in to comment.