Skip to content

Commit 61f84e7

Browse files
committed
fix review
Signed-off-by: Daniil Antoshin <[email protected]>
1 parent ca6c314 commit 61f84e7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

images/virtualization-artifact/pkg/controller/vmop/snapshot/internal/step/cleanup_snapshot_step.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222

2323
corev1 "k8s.io/api/core/v1"
24+
apierrors "k8s.io/apimachinery/pkg/api/errors"
2425
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2526
"k8s.io/apimachinery/pkg/types"
2627
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -96,7 +97,7 @@ func (s CleanupSnapshotStep) Take(ctx context.Context, vmop *v1alpha2.VirtualMac
9697

9798
if !object.IsTerminating(vmSnapshot) {
9899
err := s.client.Delete(ctx, vmSnapshot)
99-
if err != nil {
100+
if err != nil && !apierrors.IsNotFound(err) {
100101
return &reconcile.Result{}, fmt.Errorf("failed to delete the `VirtualMachineSnapshot`: %w", err)
101102
}
102103

images/virtualization-artifact/pkg/controller/vmop/snapshot/internal/step/create_snapshot_step.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s CreateSnapshotStep) Take(ctx context.Context, vmop *v1alpha2.VirtualMach
7676
)
7777
common.SetPhaseCloneConditionToFailed(s.cb, &vmop.Status.Phase, err)
7878

79-
return &reconcile.Result{}, fmt.Errorf("virtual machine snapshot %q is in failed phase", vmSnapshotKey.Name)
79+
return &reconcile.Result{}, fmt.Errorf("virtual machine snapshot %q is in failed phase: %w. Try again with new VMOP Clone operation", vmSnapshotKey.Name, err)
8080
case v1alpha2.VirtualMachineSnapshotPhaseReady:
8181
conditions.SetCondition(
8282
rcb.Status(metav1.ConditionTrue).Reason(vmopcondition.ReasonSnapshotOperationReady).Message("Snapshot is ready for clone operation."),

0 commit comments

Comments
 (0)