Skip patching the PV in finalization for failed operation

This commit makes change in restore finalizer controller, to make it
check the status in item operation of a PVC before patch the PV that is
bound to it.  If the operation is not successful it will skip patching
the PV.

Signed-off-by: Daniel Jiang <daniel.jiang@broadcom.com>
This commit is contained in:
Daniel Jiang
2025-01-09 01:42:50 +08:00
parent 3eaa73962b
commit dc02caf2b0
6 changed files with 415 additions and 83 deletions
+2 -1
View File
@@ -21,6 +21,7 @@ import (
"github.com/spf13/cobra"
apiextensions "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"github.com/vmware-tanzu/velero/pkg/constant"
"github.com/vmware-tanzu/velero/pkg/datamover"
dia "github.com/vmware-tanzu/velero/internal/delete/actions/csi"
@@ -162,7 +163,7 @@ func NewCommand(f client.Factory) *cobra.Command {
newVolumeSnapshotClassBackupItemAction,
).
RegisterRestoreItemActionV2(
"velero.io/csi-pvc-restorer",
constant.PluginCSIPVCRestoreRIA,
newPvcRestoreItemAction(f),
).
RegisterRestoreItemActionV2(