Skip to content

Commit

Permalink
Create ip label map, if not existing
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Jun 10, 2024
1 parent b2c1f37 commit 688dc58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/ip_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ func (r *IPReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Re
return ctrl.Result{}, err
}

if ip.Labels == nil {
ip.Labels = map[string]string{}
}
ip.Labels[IPFamilyLabelKey] = string(subnet.Status.Type)
err = r.Update(ctx, ip)
return ctrl.Result{}, err
Expand Down

0 comments on commit 688dc58

Please sign in to comment.