Skip to content

Commit

Permalink
fix(vmop): fix panic if VM is not exist (#129)
Browse files Browse the repository at this point in the history
Description
Fix panic in UpdateStatus for non existing VM

Signed-off-by: yaroslavborbat <[email protected]>
(cherry picked from commit 9b90641)
  • Loading branch information
yaroslavborbat authored and universal-itengineer committed Jun 13, 2024
1 parent b044a54 commit e7786d1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (r *Reconciler) UpdateStatus(_ context.Context, _ reconcile.Request, state
vmopStatus.FailureMessage = result.Message()
}
}
if state.IsInProgress() && r.IsCompleted(state.VMOP.Current().Spec.Type, state.VM.Status.Phase) {
if !state.VmIsEmpty() && state.IsInProgress() && r.IsCompleted(state.VMOP.Current().Spec.Type, state.VM.Status.Phase) {
vmopStatus.Phase = virtv2.VMOPPhaseCompleted
}
state.VMOP.Changed().Status = *vmopStatus
Expand Down

0 comments on commit e7786d1

Please sign in to comment.