Merge pull request #10106 from blackpiglet/jxun/cbt_modification

Fix some issues for CBT features:
This commit is contained in:
lyndon-li
2026-08-04 16:02:11 +08:00
committed by GitHub
19 changed files with 87 additions and 49 deletions
+1
View File
@@ -0,0 +1 @@
Fix some issues for CBT features: logs, CRD change, GetDataMover.
+1 -1
View File
@@ -59,7 +59,7 @@ spec:
datamover:
description: |-
DataMover specifies the data mover to be used by the backup.
If DataMover is "" or "velero", the built-in data mover will be used.
If DataMover is "" or "velero", the default built-in data mover will be used.
type: string
defaultVolumesToFsBackup:
description: |-
+1 -1
View File
@@ -98,7 +98,7 @@ spec:
datamover:
description: |-
DataMover specifies the data mover to be used by the backup.
If DataMover is "" or "velero", the built-in data mover will be used.
If DataMover is "" or "velero", the default built-in data mover will be used.
type: string
defaultVolumesToFsBackup:
description: |-
File diff suppressed because one or more lines are too long
@@ -92,7 +92,7 @@ spec:
datamover:
description: |-
DataMover specifies the data mover to be used by the backup.
If DataMover is "" or "velero", the built-in data mover will be used.
If DataMover is "" or "velero", the built-in fs data mover will be used.
type: string
nodeOS:
description: NodeOS is OS of the node where the DataDownload is processed.
@@ -124,7 +124,7 @@ spec:
datamover:
description: |-
DataMover specifies the data mover to be used by the backup.
If DataMover is "" or "velero", the built-in data mover will be used.
If DataMover is "" or "velero", the built-in fs data mover will be used.
type: string
operationTimeout:
description: |-
File diff suppressed because one or more lines are too long
+11 -3
View File
@@ -31,7 +31,7 @@ import (
crclient "sigs.k8s.io/controller-runtime/pkg/client"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
datamover "github.com/vmware-tanzu/velero/pkg/util/datamover"
"github.com/vmware-tanzu/velero/pkg/util/datamover"
"github.com/vmware-tanzu/velero/pkg/util/wildcard"
)
@@ -59,6 +59,7 @@ const (
// validDataMovers is the set of data mover values accepted in the snapshot
// action's dataMover parameter.
var validDataMovers = map[string]struct{}{
datamover.DataMoverTypeEmpty: {},
datamover.DataMoverTypeVelero: {},
datamover.DataMoverTypeVeleroFs: {},
datamover.DataMoverTypeVeleroBlock: {},
@@ -90,14 +91,21 @@ func (a *Action) GetDataMover() (string, error) {
if !ok {
return datamover.GetDefaultBuiltInDataMover(), nil
}
dataMover, ok := raw.(string)
if !ok {
return "", fmt.Errorf("parameter %q must be a string, got %T", DataMoverParameter, raw)
}
if _, ok := validDataMovers[dataMover]; !ok {
return "", fmt.Errorf("invalid %q value %q, valid values are %q, %q, %q",
DataMoverParameter, dataMover, datamover.DataMoverTypeVelero, datamover.DataMoverTypeVeleroFs, datamover.DataMoverTypeVeleroBlock)
return "", fmt.Errorf("invalid %q value %q, valid values are %q, %q, %q, %q",
DataMoverParameter, dataMover, datamover.DataMoverTypeEmpty, datamover.DataMoverTypeVelero, datamover.DataMoverTypeVeleroFs, datamover.DataMoverTypeVeleroBlock)
}
// Return default data mover for backup's volume policy, when the data mover's original value is legacy value: "" or "velero".
if dataMover == datamover.DataMoverTypeEmpty || dataMover == datamover.DataMoverTypeVelero {
dataMover = datamover.GetDefaultBuiltInDataMover()
}
return dataMover, nil
}
@@ -31,6 +31,7 @@ import (
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
velerotest "github.com/vmware-tanzu/velero/pkg/test"
"github.com/vmware-tanzu/velero/pkg/util/datamover"
)
func pvcVolumeMode(mode corev1api.PersistentVolumeMode) *corev1api.PersistentVolumeMode {
@@ -2999,10 +3000,10 @@ namespacedFilterPolicies:
func TestActionGetDataMover(t *testing.T) {
testCases := []struct {
name string
action *Action
expectedMove string
expectErr bool
name string
action *Action
expectedDataMover string
expectErr bool
}{
{
name: "nil action",
@@ -3010,29 +3011,29 @@ func TestActionGetDataMover(t *testing.T) {
expectErr: true,
},
{
name: "snapshot action without parameters returns default mover",
action: &Action{Type: Snapshot},
expectedMove: "velero-fs",
name: "snapshot action without parameters returns default mover",
action: &Action{Type: Snapshot},
expectedDataMover: datamover.GetDefaultBuiltInDataMover(),
},
{
name: "snapshot action without dataMover parameter returns default mover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"other": "value"}},
expectedMove: "velero-fs",
name: "snapshot action without dataMover parameter returns default mover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"other": "value"}},
expectedDataMover: datamover.GetDefaultBuiltInDataMover(),
},
{
name: "snapshot action with velero dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": "velero"}},
expectedMove: "velero",
name: "snapshot action with velero dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": "velero"}},
expectedDataMover: datamover.GetDefaultBuiltInDataMover(),
},
{
name: "snapshot action with velero-fs dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": "velero-fs"}},
expectedMove: "velero-fs",
name: "snapshot action with velero-fs dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": datamover.DataMoverTypeVeleroFs}},
expectedDataMover: datamover.DataMoverTypeVeleroFs,
},
{
name: "snapshot action with velero-block dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": "velero-block"}},
expectedMove: "velero-block",
name: "snapshot action with velero-block dataMover",
action: &Action{Type: Snapshot, Parameters: map[string]any{"dataMover": datamover.DataMoverTypeVeleroBlock}},
expectedDataMover: datamover.DataMoverTypeVeleroBlock,
},
{
name: "non-snapshot action returns error",
@@ -3059,7 +3060,7 @@ func TestActionGetDataMover(t *testing.T) {
return
}
require.NoError(t, err)
assert.Equal(t, tc.expectedMove, dataMover)
assert.Equal(t, tc.expectedDataMover, dataMover)
})
}
}
+1 -1
View File
@@ -179,7 +179,7 @@ type BackupSpec struct {
SnapshotMoveData *bool `json:"snapshotMoveData,omitempty"`
// DataMover specifies the data mover to be used by the backup.
// If DataMover is "" or "velero", the built-in data mover will be used.
// If DataMover is "" or "velero", the default built-in data mover will be used.
// +optional
DataMover string `json:"datamover,omitempty"`
@@ -32,7 +32,7 @@ type DataDownloadSpec struct {
BackupStorageLocation string `json:"backupStorageLocation"`
// DataMover specifies the data mover to be used by the backup.
// If DataMover is "" or "velero", the built-in data mover will be used.
// If DataMover is "" or "velero", the built-in fs data mover will be used.
// +optional
DataMover string `json:"datamover,omitempty"`
@@ -36,7 +36,7 @@ type DataUploadSpec struct {
SourcePVC string `json:"sourcePVC"`
// DataMover specifies the data mover to be used by the backup.
// If DataMover is "" or "velero", the built-in data mover will be used.
// If DataMover is "" or "velero", the built-in fs data mover will be used.
// +optional
DataMover string `json:"datamover,omitempty"`
+5
View File
@@ -58,6 +58,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
"github.com/vmware-tanzu/velero/pkg/util/collections"
"github.com/vmware-tanzu/velero/pkg/util/datamover"
"github.com/vmware-tanzu/velero/pkg/util/encode"
kubeutil "github.com/vmware-tanzu/velero/pkg/util/kube"
"github.com/vmware-tanzu/velero/pkg/util/logging"
@@ -431,6 +432,10 @@ func (b *backupReconciler) prepareBackupRequest(ctx context.Context, backup *vel
request.Spec.BackupType = velerov1api.BackupTypeIncremental
}
if len(request.Spec.DataMover) == 0 || request.Spec.DataMover == datamover.DataMoverTypeVelero {
request.Spec.DataMover = datamover.GetDefaultBuiltInDataMover()
}
// calculate expiration
request.Status.Expiration = &metav1.Time{Time: b.clock.Now().Add(request.Spec.TTL.Duration)}
+20
View File
@@ -64,6 +64,7 @@ import (
ibav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/itemblockaction/v1"
velerotest "github.com/vmware-tanzu/velero/pkg/test"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
"github.com/vmware-tanzu/velero/pkg/util/datamover"
kubeutil "github.com/vmware-tanzu/velero/pkg/util/kube"
"github.com/vmware-tanzu/velero/pkg/util/logging"
)
@@ -805,6 +806,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -846,6 +848,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -891,6 +894,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -933,6 +937,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -975,6 +980,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1018,6 +1024,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1061,6 +1068,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1104,6 +1112,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1147,6 +1156,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1191,6 +1201,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFailed,
@@ -1235,6 +1246,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFailed,
@@ -1279,6 +1291,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1324,6 +1337,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1369,6 +1383,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1414,6 +1429,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1460,6 +1476,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1505,6 +1522,7 @@ func TestProcessBackupCompletions(t *testing.T) {
ExcludedClusterScopedResources: autoExcludeClusterScopedResources,
ExcludedNamespaceScopedResources: autoExcludeNamespaceScopedResources,
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1556,6 +1574,7 @@ func TestProcessBackupCompletions(t *testing.T) {
IncludedNamespaceScopedResources: []string{"pods"},
ExcludedNamespaceScopedResources: append([]string{"secrets"}, autoExcludeNamespaceScopedResources...),
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
@@ -1607,6 +1626,7 @@ func TestProcessBackupCompletions(t *testing.T) {
IncludedNamespaceScopedResources: []string{"pods"},
ExcludedNamespaceScopedResources: append([]string{"secrets"}, autoExcludeNamespaceScopedResources...),
BackupType: velerov1api.BackupTypeIncremental,
DataMover: datamover.GetDefaultBuiltInDataMover(),
},
Status: velerov1api.BackupStatus{
Phase: velerov1api.BackupPhaseFinalizing,
+3 -3
View File
@@ -466,7 +466,7 @@ func (r *DataDownloadReconciler) OnDataDownloadCompleted(ctx context.Context, na
defer r.dataPathMgr.RemoveAsyncBR(ddName)
log := r.logger.WithField("datadownload", ddName)
log.Info("Async fs restore data path completed")
log.Info("Async restore data path completed")
var dd velerov2alpha1api.DataDownload
if err := r.client.Get(ctx, types.NamespacedName{Name: ddName, Namespace: namespace}, &dd); err != nil {
@@ -513,7 +513,7 @@ func (r *DataDownloadReconciler) OnDataDownloadFailed(ctx context.Context, names
log := r.logger.WithField("datadownload", ddName)
log.WithError(err).Error("Async fs restore data path failed")
log.WithError(err).Error("Async restore data path failed")
var dd velerov2alpha1api.DataDownload
if getErr := r.client.Get(ctx, types.NamespacedName{Name: ddName, Namespace: namespace}, &dd); getErr != nil {
@@ -528,7 +528,7 @@ func (r *DataDownloadReconciler) OnDataDownloadCancelled(ctx context.Context, na
log := r.logger.WithField("datadownload", ddName)
log.Warn("Async fs backup data path canceled")
log.Warn("Async restore data path canceled")
var dd velerov2alpha1api.DataDownload
if getErr := r.client.Get(ctx, types.NamespacedName{Name: ddName, Namespace: namespace}, &dd); getErr != nil {
+3 -3
View File
@@ -482,7 +482,7 @@ func (r *DataUploadReconciler) OnDataUploadCompleted(ctx context.Context, namesp
log := r.logger.WithField("dataupload", duName)
log.Info("Async fs backup data path completed")
log.Info("Async backup data path completed")
var du velerov2alpha1api.DataUpload
if err := r.client.Get(ctx, types.NamespacedName{Name: duName, Namespace: namespace}, &du); err != nil {
@@ -534,7 +534,7 @@ func (r *DataUploadReconciler) OnDataUploadFailed(ctx context.Context, namespace
log := r.logger.WithField("dataupload", duName)
log.WithError(err).Error("Async fs backup data path failed")
log.WithError(err).Error("Async backup data path failed")
var du velerov2alpha1api.DataUpload
if getErr := r.client.Get(ctx, types.NamespacedName{Name: duName, Namespace: namespace}, &du); getErr != nil {
@@ -549,7 +549,7 @@ func (r *DataUploadReconciler) OnDataUploadCancelled(ctx context.Context, namesp
log := r.logger.WithField("dataupload", duName)
log.Warn("Async fs backup data path canceled")
log.Warn("Async backup data path canceled")
du := &velerov2alpha1api.DataUpload{}
if getErr := r.client.Get(ctx, types.NamespacedName{Name: duName, Namespace: namespace}, du); getErr != nil {
+5 -5
View File
@@ -225,7 +225,7 @@ func (r *BackupMicroService) RunCancelableDataPath(ctx context.Context) (string,
return "", errors.Wrap(err, "error starting data path backup")
}
log.Info("Async fs backup data path started")
log.Info("Async backup data path started")
r.eventRecorder.Event(du, false, datapath.EventReasonStarted, "Data path for %s started", du.Name)
result := ""
@@ -240,7 +240,7 @@ func (r *BackupMicroService) RunCancelableDataPath(ctx context.Context) (string,
}
if err != nil {
log.WithError(err).Error("Async fs backup was not completed")
log.WithError(err).Error("Async backup was not completed")
}
r.eventRecorder.EndingEvent(du, false, datapath.EventReasonStopped, "Data path for %s stopped", du.Name)
@@ -277,12 +277,12 @@ func (r *BackupMicroService) OnDataUploadCompleted(ctx context.Context, namespac
}
}
log.Info("Async fs backup completed")
log.Info("Async backup completed")
}
func (r *BackupMicroService) OnDataUploadFailed(ctx context.Context, namespace string, duName string, err error) {
log := r.logger.WithField("dataupload", duName)
log.WithError(err).Error("Async fs backup data path failed")
log.WithError(err).Error("Async backup data path failed")
r.eventRecorder.Event(r.dataUpload, false, datapath.EventReasonFailed, "Data path for data upload %s failed, error %v", r.dataUploadName, err)
r.resultSignal <- dataPathResult{
@@ -292,7 +292,7 @@ func (r *BackupMicroService) OnDataUploadFailed(ctx context.Context, namespace s
func (r *BackupMicroService) OnDataUploadCancelled(ctx context.Context, namespace string, duName string) {
log := r.logger.WithField("dataupload", duName)
log.Warn("Async fs backup data path canceled")
log.Warn("Async backup data path canceled")
r.eventRecorder.Event(r.dataUpload, false, datapath.EventReasonCancelled, "Data path for data upload %s canceled", duName)
r.resultSignal <- dataPathResult{
+4 -4
View File
@@ -184,7 +184,7 @@ func (r *RestoreMicroService) RunCancelableDataPath(ctx context.Context) (string
return "", errors.Wrap(err, "error starting data path restore")
}
log.Info("Async fs restore data path started")
log.Info("Async restore data path started")
r.eventRecorder.Event(dd, false, datapath.EventReasonStarted, "Data path for %s started", dd.Name)
result := ""
@@ -234,12 +234,12 @@ func (r *RestoreMicroService) OnDataDownloadCompleted(ctx context.Context, names
}
}
log.Info("Async fs restore data path completed")
log.Info("Async restore data path completed")
}
func (r *RestoreMicroService) OnDataDownloadFailed(ctx context.Context, namespace string, ddName string, err error) {
log := r.logger.WithField("datadownload", ddName)
log.WithError(err).Error("Async fs restore data path failed")
log.WithError(err).Error("Async restore data path failed")
r.eventRecorder.Event(r.dataDownload, false, datapath.EventReasonFailed, "Data path for data download %s failed, error %v", r.dataDownloadName, err)
r.resultSignal <- dataPathResult{
@@ -249,7 +249,7 @@ func (r *RestoreMicroService) OnDataDownloadFailed(ctx context.Context, namespac
func (r *RestoreMicroService) OnDataDownloadCancelled(ctx context.Context, namespace string, ddName string) {
log := r.logger.WithField("datadownload", ddName)
log.Warn("Async fs restore data path canceled")
log.Warn("Async restore data path canceled")
r.eventRecorder.Event(r.dataDownload, false, datapath.EventReasonCancelled, "Data path for data download %s canceled", ddName)
r.resultSignal <- dataPathResult{
+3
View File
@@ -20,6 +20,7 @@ limitations under the License.
package datamover
const (
DataMoverTypeEmpty = ""
// DataMoverTypeVelero refers to the default built-in data mover. The default
// data mover may change among releases; see GetDefaultBuiltInDataMover.
DataMoverTypeVelero = "velero"
@@ -35,6 +36,7 @@ func IsBuiltInDataMover(dataMover string) bool {
return IsVeleroBlockDataMover(dataMover) || IsVeleroFSDataMover(dataMover)
}
// IsVeleroFSDataMover checks whether the given data mover belongs to fs type.
func IsVeleroFSDataMover(dataMover string) bool {
if dataMover == "" || dataMover == DataMoverTypeVelero {
dataMover = DataMoverTypeVeleroFs
@@ -42,6 +44,7 @@ func IsVeleroFSDataMover(dataMover string) bool {
return dataMover == DataMoverTypeVeleroFs
}
// IsVeleroBlockDataMover checks whether the given data mover belongs to block type.
func IsVeleroBlockDataMover(dataMover string) bool {
return dataMover == DataMoverTypeVeleroBlock
}