From 6d4987a1e1ecaa045e3cae07f59b16ba83766efb Mon Sep 17 00:00:00 2001 From: "dmitry.lopatin" Date: Sun, 20 Oct 2024 22:31:39 +0300 Subject: [PATCH] fix inuse.go Signed-off-by: dmitry.lopatin --- .../pkg/controller/vd/internal/inuse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go b/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go index fd8b8cc7a..66b5d3f9e 100644 --- a/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go +++ b/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go @@ -130,7 +130,7 @@ 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 { @@ -138,7 +138,7 @@ func (h InUseHandler) Handle(ctx context.Context, vd *virtv2.VirtualDisk) (recon 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 {