Delete moved snapshots when the backup is deleted

This commit introduces a deleteItemAction which writes a temporary configmap to
record the snapshot info so that the controller can trigger repo manager
to remove the snapshot

This process is a bit chatty and we should consider to refactor the code
so it's easier to connect to the repo directly in the DIA

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
Daniel Jiang
2023-07-27 13:27:33 +08:00
parent 9c8275eda7
commit b0a343cd48
10 changed files with 257 additions and 11 deletions
+5 -5
View File
@@ -53,10 +53,10 @@ import (
"github.com/vmware-tanzu/velero/pkg/util/kube"
)
const dataMoverType string = "velero"
const dataUploadDownloadRequestor string = "snapshot-data-upload-download"
const preparingMonitorFrequency time.Duration = time.Minute
const (
dataUploadDownloadRequestor string = "snapshot-data-upload-download"
preparingMonitorFrequency time.Duration = time.Minute
)
// DataUploadReconciler reconciles a DataUpload object
type DataUploadReconciler struct {
@@ -116,7 +116,7 @@ func (r *DataUploadReconciler) Reconcile(ctx context.Context, req ctrl.Request)
return ctrl.Result{}, errors.Wrap(err, "getting DataUpload")
}
if du.Spec.DataMover != "" && du.Spec.DataMover != dataMoverType {
if !datamover.IsBuiltInUploader(du.Spec.DataMover) {
log.WithField("Data mover", du.Spec.DataMover).Debug("it is not one built-in data mover which is not supported by Velero")
return ctrl.Result{}, nil
}