Skip to content

Commit

Permalink
Handle possible nil map assignment (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <[email protected]>
Co-authored-by: Waleed Malik <[email protected]>
  • Loading branch information
kubermatic-bot and ahmedwaleedmalik authored Sep 30, 2024
1 parent 1d4d093 commit c276401
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/controllers/kubelb/loadbalancer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ func (r *LoadBalancerReconciler) reconcileService(ctx context.Context, loadBalan
ports = append(ports, allocatedPort)
}

if service.Annotations == nil {
service.Annotations = make(map[string]string)
}

for k, v := range kubelb.PropagateAnnotations(loadBalancer.Annotations, annotations) {
service.Annotations[k] = v
}
Expand Down

0 comments on commit c276401

Please sign in to comment.