diff --git a/controllers/ip_controller.go b/controllers/ip_controller.go index 738f985..1eac20c 100644 --- a/controllers/ip_controller.go +++ b/controllers/ip_controller.go @@ -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