Skip to content

Commit 5a35d03

Browse files
committed
fix
Signed-off-by: Daniil Antoshin <[email protected]>
1 parent 0c26121 commit 5a35d03

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

api/core/v1alpha2/vdcondition/condition.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
DatasourceReadyType Type = "DatasourceReady"
2929
// ReadyType indicates whether the import process succeeded and the `VirtualDisk` is ready for use.
3030
ReadyType Type = "Ready"
31-
// ResizingType indicates whether the disk resizing operation is completed.
31+
// ResizingType indicates whether a disk resizing operation is in progress.
3232
ResizingType Type = "Resizing"
3333
// SnapshottingType indicates whether the disk snapshotting operation is in progress.
3434
SnapshottingType Type = "Snapshotting"

images/virtualization-artifact/pkg/controller/vd/internal/snapshotting.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ func (h SnapshottingHandler) Handle(ctx context.Context, vd *virtv2.VirtualDisk)
7474
continue
7575
}
7676

77-
resized, _ := conditions.GetCondition(vdcondition.ResizingType, vd.Status.Conditions)
78-
if resized.Reason == vdcondition.InProgress.String() {
77+
resizing, _ := conditions.GetCondition(vdcondition.ResizingType, vd.Status.Conditions)
78+
if resizing.Status == metav1.ConditionTrue && vd.Generation == resizing.ObservedGeneration {
7979
cb.
8080
Status(metav1.ConditionFalse).
8181
Reason(vdcondition.SnapshottingNotAvailable).

images/virtualization-artifact/pkg/controller/vmsnapshot/internal/life_cycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ func (h LifeCycleHandler) ensureBlockDeviceConsistency(ctx context.Context, vm *
463463
}
464464

465465
resizingReady, _ := conditions.GetCondition(vdcondition.ResizingType, vd.Status.Conditions)
466-
if resizingReady.Reason == vdcondition.InProgress.String() {
466+
if resizingReady.Status == metav1.ConditionTrue && vd.Generation == resizingReady.ObservedGeneration {
467467
return fmt.Errorf("%w: waiting for the virtual disk %q to be resized", ErrVirtualDiskResizing, vd.Name)
468468
}
469469
}

0 commit comments

Comments
 (0)