Skip to content

Commit

Permalink
refactor(vmip): add log message when VirtualMachineIPAddressLease is …
Browse files Browse the repository at this point in the history
…bound to another

Signed-off-by: Dmitry Lopatin <[email protected]>
  • Loading branch information
LopatinDmitr committed Aug 15, 2024
1 parent 8b5551d commit 40c6496
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ func (h *LifecycleHandler) Handle(ctx context.Context, state state.VMIPState) (r
case lease.Status.Phase == virtv2.VirtualMachineIPAddressLeasePhaseBound:
if vmipStatus.Phase != virtv2.VirtualMachineIPAddressPhasePending {
vmipStatus.Phase = virtv2.VirtualMachineIPAddressPhasePending
log.Warn(fmt.Sprintf("VirtualMachineIPAddressLease %s is bound to another VirtualMachineIPAddress resource: %s/%s",
lease.Name, lease.Spec.VirtualMachineIPAddressRef.Name, lease.Spec.VirtualMachineIPAddressRef.Namespace))
mgr.Update(conditionBound.Status(metav1.ConditionFalse).
Reason(vmipcondition.VirtualMachineIPAddressLeaseAlready).
Message(fmt.Sprintf("VirtualMachineIPAddressLease %s is bound to another VirtualMachineIP",
common.IpToLeaseName(vmipStatus.Address))).
Message(fmt.Sprintf("VirtualMachineIPAddressLease %s is bound to another VirtualMachineIPAddress resource",
lease.Name)).
Condition())
}

Expand Down

0 comments on commit 40c6496

Please sign in to comment.