Skip to content

Commit

Permalink
fix inuse.go
Browse files Browse the repository at this point in the history
Signed-off-by: dmitry.lopatin <[email protected]>
  • Loading branch information
LopatinDmitr committed Oct 20, 2024
1 parent 806bf11 commit 6d4987a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ func (h InUseHandler) Handle(ctx context.Context, vd *virtv2.VirtualDisk) (recon
}
}

if inUseCondition.Status == metav1.ConditionFalse && inUseInRunningVirtualMachine {
if inUseCondition.Status != metav1.ConditionTrue && inUseInRunningVirtualMachine {
inUseCondition.Status = metav1.ConditionTrue
inUseCondition.Reason = vdcondition.InUseInRunningVirtualMachine
} else if inUseCondition.Reason == vdcondition.InUseInRunningVirtualMachine {
inUseCondition.Status = metav1.ConditionFalse
inUseCondition.Reason = vdcondition.NotInUse
}

if inUseCondition.Status == metav1.ConditionFalse && inUseForCreateImage {
if inUseCondition.Status != metav1.ConditionTrue && inUseForCreateImage {
inUseCondition.Status = metav1.ConditionTrue
inUseCondition.Reason = vdcondition.InUseForCreateImage
} else if inUseCondition.Reason == vdcondition.InUseForCreateImage {
Expand Down

0 comments on commit 6d4987a

Please sign in to comment.