Skip to content

Commit

Permalink
fix(vmop): set uid vm label (#537)
Browse files Browse the repository at this point in the history
set uid vm label

Signed-off-by: yaroslavborbat <yaroslav.752@gmail.com>
  • Loading branch information
yaroslavborbat authored Nov 25, 2024
1 parent 0056296 commit d988fc3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func (h LifecycleHandler) Handle(ctx context.Context, s state.VMOperationState)

// Initialize new VMOP resource: set label with vm name, set phase to Pending and all conditions to Unknown.
if changed.Status.Phase == "" {
cc.AddLabel(changed, cc.LabelVirtualMachineUID, string(changed.GetUID()))
changed.Status.Phase = virtv2.VMOPPhasePending
// Add all conditions in unknown state.
conditions.SetCondition(
Expand Down Expand Up @@ -107,6 +106,7 @@ func (h LifecycleHandler) Handle(ctx context.Context, s state.VMOperationState)
&changed.Status.Conditions)
return reconcile.Result{}, nil
}
cc.AddLabel(changed, cc.LabelVirtualMachineUID, string(vm.GetUID()))

if changed.Status.Phase == virtv2.VMOPPhaseInProgress {
log.Debug("Operation in progress, check if VM is completed", "vm.phase", vm.Status.Phase, "vmop.phase", changed.Status.Phase)
Expand Down

0 comments on commit d988fc3

Please sign in to comment.