Skip to content

Commit 04b73ba

Browse files
author
Roman Sysoev
committed
fix: mark snapshot consistent even requiredConsistency is false
Signed-off-by: Roman Sysoev <[email protected]>
1 parent dd6bbac commit 04b73ba

File tree

1 file changed

+3
-7
lines changed
  • images/virtualization-artifact/pkg/controller/vdsnapshot/internal

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (h LifeCycleHandler) Handle(ctx context.Context, vdSnapshot *v1alpha2.Virtu
192192

193193
switch {
194194
case vs == nil:
195-
if vm != nil && vm.Status.Phase != v1alpha2.MachineStopped && !isFSFrozen && vdSnapshot.Spec.RequiredConsistency {
195+
if vm != nil && vm.Status.Phase != v1alpha2.MachineStopped && !isFSFrozen {
196196
canFreeze, err := h.snapshotter.CanFreeze(ctx, kvvmi)
197197
if err != nil {
198198
if errors.Is(err, service.ErrUntrustedFilesystemFrozenCondition) {
@@ -379,12 +379,12 @@ func (h LifeCycleHandler) Handle(ctx context.Context, vdSnapshot *v1alpha2.Virtu
379379
} else {
380380
switch {
381381
case vm == nil, vm.Status.Phase == v1alpha2.MachineStopped:
382-
if vdSnapshot.Spec.RequiredConsistency && vdSnapshot.Status.Consistent == nil || !*vdSnapshot.Status.Consistent {
382+
if vdSnapshot.Status.Consistent == nil || !*vdSnapshot.Status.Consistent {
383383
vdSnapshot.Status.Consistent = ptr.To(true)
384384
return reconcile.Result{RequeueAfter: 2 * time.Second}, nil
385385
}
386386
case isFrozen && vdSnapshot.Spec.RequiredConsistency:
387-
if vdSnapshot.Spec.RequiredConsistency && vdSnapshot.Status.Consistent == nil || !*vdSnapshot.Status.Consistent {
387+
if vdSnapshot.Status.Consistent == nil || !*vdSnapshot.Status.Consistent {
388388
vdSnapshot.Status.Consistent = ptr.To(true)
389389
return reconcile.Result{RequeueAfter: 2 * time.Second}, nil
390390
}
@@ -500,10 +500,6 @@ func (h LifeCycleHandler) unfreezeFilesystem(ctx context.Context, vdSnapshot *v1
500500
}
501501

502502
func (h LifeCycleHandler) isConsistent(vdSnapshot *v1alpha2.VirtualDiskSnapshot) bool {
503-
if !vdSnapshot.Spec.RequiredConsistency {
504-
return false
505-
}
506-
507503
if vdSnapshot.Status.Consistent == nil {
508504
return false
509505
}

0 commit comments

Comments
 (0)