Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Daniil Antoshin <[email protected]>
  • Loading branch information
danilrwx committed Dec 16, 2024
1 parent 24fdfff commit cb0b59d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/core/v1alpha2/vdcondition/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
DatasourceReadyType Type = "DatasourceReady"
// ReadyType indicates whether the import process succeeded and the `VirtualDisk` is ready for use.
ReadyType Type = "Ready"
// ResizingType indicates whether the disk resizing operation is completed.
// ResizingType indicates whether a disk resizing operation is in progress.
ResizingType Type = "Resizing"
// SnapshottingType indicates whether the disk snapshotting operation is in progress.
SnapshottingType Type = "Snapshotting"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ func (h SnapshottingHandler) Handle(ctx context.Context, vd *virtv2.VirtualDisk)
continue
}

resized, _ := conditions.GetCondition(vdcondition.ResizingType, vd.Status.Conditions)
if resized.Reason == vdcondition.InProgress.String() {
resizing, _ := conditions.GetCondition(vdcondition.ResizingType, vd.Status.Conditions)
if resizing.Status == metav1.ConditionTrue && vd.Generation == resizing.ObservedGeneration {
cb.
Status(metav1.ConditionFalse).
Reason(vdcondition.SnapshottingNotAvailable).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func (h LifeCycleHandler) ensureBlockDeviceConsistency(ctx context.Context, vm *
}

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

0 comments on commit cb0b59d

Please sign in to comment.