Skip to content

Commit

Permalink
Merge pull request #3734 from fad3t/ambassador-external-ip
Browse files Browse the repository at this point in the history
feat: add support for external IP in ambassador host source
  • Loading branch information
k8s-ci-robot authored Oct 27, 2023
2 parents 8bc1c20 + 73862a8 commit d8f408b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions source/ambassador_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (sc *ambassadorHostSource) endpointsFromHost(ctx context.Context, host *amb
return endpoints, nil
}

func (sc *ambassadorHostSource) targetsFromAmbassadorLoadBalancer(ctx context.Context, service string) (targets endpoint.Targets, err error) {
func (sc *ambassadorHostSource) targetsFromAmbassadorLoadBalancer(ctx context.Context, service string) (endpoint.Targets, error) {
lbNamespace, lbName, err := parseAmbLoadBalancerService(service)
if err != nil {
return nil, err
Expand All @@ -196,16 +196,9 @@ func (sc *ambassadorHostSource) targetsFromAmbassadorLoadBalancer(ctx context.Co
return nil, err
}

for _, lb := range svc.Status.LoadBalancer.Ingress {
if lb.IP != "" {
targets = append(targets, lb.IP)
}
if lb.Hostname != "" {
targets = append(targets, lb.Hostname)
}
}
var targets = extractLoadBalancerTargets(svc, true)

return
return targets, nil
}

// parseAmbLoadBalancerService returns a name/namespace tuple from the annotation in
Expand Down

0 comments on commit d8f408b

Please sign in to comment.