Skip to content

Commit

Permalink
Server side filtering of NBs to reduce traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
okokes-akamai committed Feb 23, 2023
1 parent 16c3e7d commit 98e9d8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cloud/linode/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,13 @@ func (l *loadbalancers) getNodeBalancerByHostname(ctx context.Context, service *
}

func (l *loadbalancers) getNodeBalancerByIPv4(ctx context.Context, service *v1.Service, ipv4 string) (*linodego.NodeBalancer, error) {
lbs, err := l.client.ListNodeBalancers(ctx, nil)
f := linodego.Filter{}
f.AddField(linodego.Eq, "ipv4", ipv4)
filter, err := json.Marshal(f)
if err != nil {
return nil, err
}
lbs, err := l.client.ListNodeBalancers(ctx, &linodego.ListOptions{Filter: string(filter)})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 98e9d8e

Please sign in to comment.