Add warning message for volume snapshotter in data mover case.

Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
Xun Jiang
2023-06-09 20:55:00 +08:00
parent aed8c8ec1b
commit a5c28ad423
3 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1 @@
Add warning message for volume snapshotter in data mover case.

View File

@@ -480,6 +480,13 @@ func (ib *itemBackupper) takePVSnapshot(obj runtime.Unstructured, log logrus.Fie
return nil
}
// TODO: Snapshot data mover is only supported for CSI plugin scenario by now.
// Need to add a mechanism to choose running which plugin for resources.
// After that, this warning can be removed.
if boolptr.IsSetToTrue(ib.backupRequest.Spec.SnapshotMoveData) {
log.Warnf("VolumeSnapshotter plugin doesn't support data movement.")
}
if ib.backupRequest.ResPolicies != nil {
if action, err := ib.backupRequest.ResPolicies.GetMatchAction(pv); err != nil {
log.WithError(err).Errorf("Error getting matched resource policies for pv %s", pv.Name)

View File

@@ -27,7 +27,7 @@ type VolumeSnapshotClassBuilder struct {
}
// ForVolumeSnapshotClass is the constructor of VolumeSnapshotClassBuilder.
func (b *VolumeSnapshotClassBuilder) ForVolumeSnapshotClass(name string) *VolumeSnapshotClassBuilder {
func ForVolumeSnapshotClass(name string) *VolumeSnapshotClassBuilder {
return &VolumeSnapshotClassBuilder{
object: &snapshotv1api.VolumeSnapshotClass{
TypeMeta: metav1.TypeMeta{