Skip to content

Commit

Permalink
controller: label IPAMClaims w/ their owner VM name
Browse files Browse the repository at this point in the history
When reacting to the VM deletion it will be easier to query for the
IPAMClaims associated to a VM, because we will be able to query for this
label.

Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed May 17, 2024
1 parent 462cb6c commit 5623761
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/vmnetworkscontroller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func (r *VirtualMachineReconciler) Reconcile(
Namespace: vmi.Namespace,
OwnerReferences: []metav1.OwnerReference{ownerInfo},
Finalizers: []string{kubevirtVMFinalizer},
Labels: map[string]string{
virtv1.VirtualMachineLabel: vmi.Name,
},
},
Spec: ipamclaimsapi.IPAMClaimSpec{
Network: netConfigName,
Expand Down

0 comments on commit 5623761

Please sign in to comment.