Skip to content

Commit

Permalink
Merge pull request #72 from m198799/main
Browse files Browse the repository at this point in the history
fix: If the load balancing service does not have the annotation kube-…
  • Loading branch information
lubronzhan authored Jan 2, 2024
2 parents 376a9ba + 4047a91 commit ab3c06f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/provider/loadBalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ func (k *kubevipLoadBalancerManager) syncLoadBalancer(ctx context.Context, servi

builder := &netipx.IPSetBuilder{}
for x := range svcs.Items {
addr, err := netip.ParseAddr(svcs.Items[x].Annotations[loadbalancerIPsAnnotations])
if err != nil {
return nil, err
if ip, ok := svcs.Items[x].Annotations[loadbalancerIPsAnnotations]; ok {
addr, err := netip.ParseAddr(ip)
if err != nil {
return nil, err
}
builder.Add(addr)
}
builder.Add(addr)
}
inUseSet, err := builder.IPSet()
if err != nil {
Expand Down

0 comments on commit ab3c06f

Please sign in to comment.