Skip to content

Commit

Permalink
try to get nodebalancers by IP before hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
0xch4z committed Mar 5, 2021
1 parent 262d789 commit 4bbf096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ func (l *loadbalancers) getLatestServiceLoadBalancerStatus(ctx context.Context,
// most recent LoadBalancer status.
func (l *loadbalancers) getNodeBalancerByStatus(ctx context.Context, service *v1.Service) (nb *linodego.NodeBalancer, err error) {
for _, ingress := range service.Status.LoadBalancer.Ingress {
if ingress.Hostname != "" {
return l.getNodeBalancerByHostname(ctx, service, ingress.Hostname)
}
if ingress.IP != "" {
return l.getNodeBalancerByIPv4(ctx, service, ingress.IP)
}
if ingress.Hostname != "" {
return l.getNodeBalancerByHostname(ctx, service, ingress.Hostname)
}
}
return nil, lbNotFoundError{serviceNn: getServiceNn(service)}
}
Expand Down

0 comments on commit 4bbf096

Please sign in to comment.