Skip to content

Commit

Permalink
Use map of struct instead of bool (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
HomayoonAlimohammadi committed Sep 24, 2024
1 parent a5d0ae4 commit a2c00fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/k8s/pkg/k8sd/features/metallb/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ func waitForRequiredLoadBalancerCRDs(ctx context.Context, snap snap.Snap, bgpMod
return false, nil
}

requiredCRDs := map[string]bool{
"metallb.io/v1beta1:ipaddresspools": true,
"metallb.io/v1beta1:l2advertisements": true,
requiredCRDs := map[string]struct{}{
"metallb.io/v1beta1:ipaddresspools": {},
"metallb.io/v1beta1:l2advertisements": {},
}
if bgpMode {
requiredCRDs["metallb.io/v1beta2:bgppeers"] = true
requiredCRDs["metallb.io/v1beta1:bgpadvertisements"] = true
requiredCRDs["metallb.io/v1beta2:bgppeers"] = struct{}{}
requiredCRDs["metallb.io/v1beta1:bgpadvertisements"] = struct{}{}
}

requiredCount := len(requiredCRDs)
Expand Down

0 comments on commit a2c00fb

Please sign in to comment.