diff --git a/changelogs/unreleased/9040-blackpiglet b/changelogs/unreleased/9040-blackpiglet new file mode 100644 index 0000000000..9475e8efa0 --- /dev/null +++ b/changelogs/unreleased/9040-blackpiglet @@ -0,0 +1 @@ +Remove dependency with VolumeSnapshotClass in DataUpload. diff --git a/config/crd/v2alpha1/bases/velero.io_datauploads.yaml b/config/crd/v2alpha1/bases/velero.io_datauploads.yaml index 48d711a064..be2bb08615 100644 --- a/config/crd/v2alpha1/bases/velero.io_datauploads.yaml +++ b/config/crd/v2alpha1/bases/velero.io_datauploads.yaml @@ -87,6 +87,9 @@ spec: of the CSI snapshot. nullable: true properties: + driver: + description: Driver is the driver used by the VolumeSnapshotContent + type: string snapshotClass: description: SnapshotClass is the name of the snapshot class that the volume snapshot is created with diff --git a/config/crd/v2alpha1/crds/crds.go b/config/crd/v2alpha1/crds/crds.go index 41755922ea..067ba4ae5f 100644 --- a/config/crd/v2alpha1/crds/crds.go +++ b/config/crd/v2alpha1/crds/crds.go @@ -30,7 +30,7 @@ import ( var rawCRDs = [][]byte{ []byte("\x1f\x8b\b\x00\x00\x00\x00\x00\x00\xff\xbcYɒ\x1b\xb9\x11\xbd\xf7Wd\xc8\a]D\xb6\xe5e\xc2\xc1\x9bĶ#:\xa0f\xb3\xd9\x033\xe2\r\xad\x13Z-\x80\x19\x81?yT\xf4\xcfͿ\xfd\xcdͅ~\xdc}|\xf8&\x14_\xc028\xaf\xeb\x1f\xd0\xe9`K|\u008dP\xc2\v\xad\x1ej\xf4\x8c3\xcf\x16\x0f\x00L)\xed\x19\r;\xfa\vPj孖\x12\xed\xacB5\xff\x16\n,\x82\x90\x1cmT\xden\xbd\xfb\xe3\xfc\xe3w\xf3\xbf>\x00(V\xe3\x02H\x1f\xd7{%5\xe3n\xbeC\x89Vυ~p\x06KR\\Y\x1d\xcc\x02\x8e\x13ia\xb3i\x02\xfc\xc4<{jt\xc4a)\x9c\xff\xe7d\xea{\xe1|\x9c62X&G{\xc7\x19'T\x15$\xb3ù\a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a\xf8\x10\xaf\"/QZ*\xad\x0f\xaf\x84\x87\x8a\xc6w\x9ds\xba\x1cv\xdb/+\xc2z\x7fXpUQڣ0\x91\xae\xb5\x7f\xe7\x90K\x8aV\x04\x06\x04A\xfe]j9|\x89\xbe\xed\x1e\xb6\x99m\x1fNJ\x8a\xc9-\xe6*=%)\a\xf09\xc4\xe5\xf9W_\xa0\xef\x99ze\xbdj4\xe89/\x13\xdam/1\x1dq\xeb\xee\xb5r\x01\xff\xfd\xffͯ\x01\x00\x00\xff\xff\xee\xe6t\xbc\x8f$\x00\x00"), } var CRDs = crds() diff --git a/internal/volume/volumes_information.go b/internal/volume/volumes_information.go index d0c70a2b8c..a080ee7b30 100644 --- a/internal/volume/volumes_information.go +++ b/internal/volume/volumes_information.go @@ -402,7 +402,6 @@ func (v *BackupVolumesInformation) generateVolumeInfoForCSIVolumeSnapshot() { tmpVolumeInfos := make([]*BackupVolumeInfo, 0) for _, volumeSnapshot := range v.volumeSnapshots { - var volumeSnapshotClass *snapshotv1api.VolumeSnapshotClass var volumeSnapshotContent *snapshotv1api.VolumeSnapshotContent // This is protective logic. The passed-in VS should be all related @@ -411,11 +410,6 @@ func (v *BackupVolumesInformation) generateVolumeInfoForCSIVolumeSnapshot() { continue } - if volumeSnapshot.Spec.VolumeSnapshotClassName == nil { - v.logger.Warnf("Cannot find VolumeSnapshotClass for VolumeSnapshot %s/%s", volumeSnapshot.Namespace, volumeSnapshot.Name) - continue - } - if volumeSnapshot.Status == nil || volumeSnapshot.Status.BoundVolumeSnapshotContentName == nil { v.logger.Warnf("Cannot fine VolumeSnapshotContent for VolumeSnapshot %s/%s", volumeSnapshot.Namespace, volumeSnapshot.Name) continue @@ -426,20 +420,14 @@ func (v *BackupVolumesInformation) generateVolumeInfoForCSIVolumeSnapshot() { continue } - for index := range v.volumeSnapshotClasses { - if *volumeSnapshot.Spec.VolumeSnapshotClassName == v.volumeSnapshotClasses[index].Name { - volumeSnapshotClass = &v.volumeSnapshotClasses[index] - } - } - for index := range v.volumeSnapshotContents { if *volumeSnapshot.Status.BoundVolumeSnapshotContentName == v.volumeSnapshotContents[index].Name { volumeSnapshotContent = &v.volumeSnapshotContents[index] } } - if volumeSnapshotClass == nil || volumeSnapshotContent == nil { - v.logger.Warnf("fail to get VolumeSnapshotContent or VolumeSnapshotClass for VolumeSnapshot: %s/%s", + if volumeSnapshotContent == nil { + v.logger.Warnf("fail to get VolumeSnapshotContent for VolumeSnapshot: %s/%s", volumeSnapshot.Namespace, volumeSnapshot.Name) continue } @@ -473,7 +461,7 @@ func (v *BackupVolumesInformation) generateVolumeInfoForCSIVolumeSnapshot() { CSISnapshotInfo: &CSISnapshotInfo{ VSCName: *volumeSnapshot.Status.BoundVolumeSnapshotContentName, Size: size, - Driver: volumeSnapshotClass.Driver, + Driver: volumeSnapshotContent.Spec.Driver, SnapshotHandle: snapshotHandle, OperationID: operation.Spec.OperationID, ReadyToUse: volumeSnapshot.Status.ReadyToUse, @@ -581,14 +569,7 @@ func (v *BackupVolumesInformation) generateVolumeInfoFromDataUpload() { } } - var vsClassList []snapshotv1api.VolumeSnapshotClass - if len(duOperationMap) > 0 { - var err error - vsClassList, err = v.getVolumeSnapshotClasses() - if err != nil { - return - } - } else { + if len(duOperationMap) <= 0 { // No DataUpload is found. Return early. return } @@ -609,13 +590,6 @@ func (v *BackupVolumesInformation) generateVolumeInfoFromDataUpload() { continue } - driverUsedByVSClass := "" - for index := range vsClassList { - if vsClassList[index].Name == dataUpload.Spec.CSISnapshot.SnapshotClass { - driverUsedByVSClass = vsClassList[index].Driver - } - } - if pvcPVInfo := v.pvMap.retrieve( "", operation.Spec.ResourceIdentifier.Name, @@ -637,7 +611,7 @@ func (v *BackupVolumesInformation) generateVolumeInfoFromDataUpload() { SnapshotHandle: FieldValueIsUnknown, VSCName: FieldValueIsUnknown, OperationID: FieldValueIsUnknown, - Driver: driverUsedByVSClass, + Driver: dataUpload.Spec.CSISnapshot.Driver, }, SnapshotDataMovementInfo: &SnapshotDataMovementInfo{ DataMover: dataMover, diff --git a/internal/volume/volumes_information_test.go b/internal/volume/volumes_information_test.go index 3233e98ce0..047dc3e5fe 100644 --- a/internal/volume/volumes_information_test.go +++ b/internal/volume/volumes_information_test.go @@ -29,6 +29,7 @@ import ( corev1api "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" @@ -415,7 +416,6 @@ func TestGenerateVolumeInfoForCSIVolumeSnapshot(t *testing.T) { BoundVolumeSnapshotContentName: stringPtr("testContent"), }, }, - volumeSnapshotClass: *builder.ForVolumeSnapshotClass("testClass").Driver("pd.csi.storage.gke.io").Result(), volumeSnapshotContent: *builder.ForVolumeSnapshotContent("testContent").Status(&snapshotv1api.VolumeSnapshotContentStatus{SnapshotHandle: stringPtr("testSnapshotHandle")}).Result(), expectedVolumeInfos: []*BackupVolumeInfo{}, }, @@ -440,8 +440,7 @@ func TestGenerateVolumeInfoForCSIVolumeSnapshot(t *testing.T) { ReadyToUse: &readyToUse, }, }, - volumeSnapshotClass: *builder.ForVolumeSnapshotClass("testClass").Driver("pd.csi.storage.gke.io").Result(), - volumeSnapshotContent: *builder.ForVolumeSnapshotContent("testContent").Status(&snapshotv1api.VolumeSnapshotContentStatus{SnapshotHandle: stringPtr("testSnapshotHandle")}).Result(), + volumeSnapshotContent: *builder.ForVolumeSnapshotContent("testContent").Driver("pd.csi.storage.gke.io").Status(&snapshotv1api.VolumeSnapshotContentStatus{SnapshotHandle: stringPtr("testSnapshotHandle")}).Result(), pvMap: map[string]pvcPvInfo{ "testPV": { PVCName: "testPVC", @@ -758,7 +757,8 @@ func TestGenerateVolumeInfoFromDataUpload(t *testing.T) { defer features.Disable(velerov1api.CSIFeatureFlag) tests := []struct { name string - volumeSnapshotClass *snapshotv1api.VolumeSnapshotClass + vs *snapshotv1api.VolumeSnapshot + vsc *snapshotv1api.VolumeSnapshotContent dataUpload *velerov2alpha1.DataUpload operation *itemoperation.BackupOperation pvMap map[string]pvcPvInfo @@ -829,87 +829,20 @@ func TestGenerateVolumeInfoFromDataUpload(t *testing.T) { }, expectedVolumeInfos: []*BackupVolumeInfo{}, }, - { - name: "VolumeSnapshotClass cannot be found for operation", - dataUpload: builder.ForDataUpload("velero", "testDU").DataMover("velero").CSISnapshot(&velerov2alpha1.CSISnapshotSpec{ - VolumeSnapshot: "testVS", - }).SnapshotID("testSnapshotHandle").StartTimestamp(&now).Result(), - operation: &itemoperation.BackupOperation{ - Spec: itemoperation.BackupOperationSpec{ - OperationID: "testOperation", - ResourceIdentifier: velero.ResourceIdentifier{ - GroupResource: schema.GroupResource{ - Group: "", - Resource: "persistentvolumeclaims", - }, - Namespace: "velero", - Name: "testPVC", - }, - PostOperationItems: []velero.ResourceIdentifier{ - { - GroupResource: schema.GroupResource{ - Group: "velero.io", - Resource: "datauploads", - }, - Namespace: "velero", - Name: "testDU", - }, - }, - }, - }, - pvMap: map[string]pvcPvInfo{ - "testPV": { - PVCName: "testPVC", - PVCNamespace: "velero", - PV: corev1api.PersistentVolume{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testPV", - Labels: map[string]string{"a": "b"}, - }, - Spec: corev1api.PersistentVolumeSpec{ - PersistentVolumeReclaimPolicy: corev1api.PersistentVolumeReclaimDelete, - }, - }, - }, - }, - expectedVolumeInfos: []*BackupVolumeInfo{ - { - PVCName: "testPVC", - PVCNamespace: "velero", - PVName: "testPV", - BackupMethod: CSISnapshot, - SnapshotDataMoved: true, - StartTimestamp: &now, - CSISnapshotInfo: &CSISnapshotInfo{ - SnapshotHandle: FieldValueIsUnknown, - VSCName: FieldValueIsUnknown, - OperationID: FieldValueIsUnknown, - Size: 0, - }, - SnapshotDataMovementInfo: &SnapshotDataMovementInfo{ - DataMover: "velero", - UploaderType: "kopia", - OperationID: "testOperation", - }, - PVInfo: &PVInfo{ - ReclaimPolicy: string(corev1api.PersistentVolumeReclaimDelete), - Labels: map[string]string{"a": "b"}, - }, - }, - }, - }, { name: "Normal DataUpload case", dataUpload: builder.ForDataUpload("velero", "testDU"). DataMover("velero"). CSISnapshot(&velerov2alpha1.CSISnapshotSpec{ - VolumeSnapshot: "testVS", + VolumeSnapshot: "vs-01", SnapshotClass: "testClass", + Driver: "pd.csi.storage.gke.io", }).SnapshotID("testSnapshotHandle"). StartTimestamp(&now). Phase(velerov2alpha1.DataUploadPhaseCompleted). Result(), - volumeSnapshotClass: builder.ForVolumeSnapshotClass("testClass").Driver("pd.csi.storage.gke.io").Result(), + vs: builder.ForVolumeSnapshot(velerov1api.DefaultNamespace, "vs-01").Status().BoundVolumeSnapshotContentName("vsc-01").Result(), + vsc: builder.ForVolumeSnapshotContent("vsc-01").Driver("pd.csi.storage.gke.io").Result(), operation: &itemoperation.BackupOperation{ Spec: itemoperation.BackupOperationSpec{ OperationID: "testOperation", @@ -995,14 +928,17 @@ func TestGenerateVolumeInfoFromDataUpload(t *testing.T) { } } - volumesInfo.crClient = velerotest.NewFakeControllerRuntimeClient(t) + objects := make([]runtime.Object, 0) if tc.dataUpload != nil { - volumesInfo.crClient.Create(context.TODO(), tc.dataUpload) + objects = append(objects, tc.dataUpload) } - - if tc.volumeSnapshotClass != nil { - volumesInfo.crClient.Create(context.TODO(), tc.volumeSnapshotClass) + if tc.vs != nil { + objects = append(objects, tc.vs) + } + if tc.vsc != nil { + objects = append(objects, tc.vsc) } + volumesInfo.crClient = velerotest.NewFakeControllerRuntimeClient(t, objects...) volumesInfo.logger = logging.DefaultLogger(logrus.DebugLevel, logging.FormatJSON) diff --git a/pkg/apis/velero/v2alpha1/data_upload_types.go b/pkg/apis/velero/v2alpha1/data_upload_types.go index 140a94ec35..14daae116b 100644 --- a/pkg/apis/velero/v2alpha1/data_upload_types.go +++ b/pkg/apis/velero/v2alpha1/data_upload_types.go @@ -79,6 +79,10 @@ type CSISnapshotSpec struct { // SnapshotClass is the name of the snapshot class that the volume snapshot is created with // +optional SnapshotClass string `json:"snapshotClass"` + + // Driver is the driver used by the VolumeSnapshotContent + // +optional + Driver string `json:"driver,omitempty"` } // DataUploadPhase represents the lifecycle phase of a DataUpload. diff --git a/pkg/backup/actions/csi/pvc_action.go b/pkg/backup/actions/csi/pvc_action.go index d1d8056a7b..8b08cdebca 100644 --- a/pkg/backup/actions/csi/pvc_action.go +++ b/pkg/backup/actions/csi/pvc_action.go @@ -281,7 +281,7 @@ func (p *pvcBackupItemAction) Execute( // Wait until VS associated VSC snapshot handle created before // returning with the Async operation for data mover. - _, err := csi.WaitUntilVSCHandleIsReady( + vsc, err := csi.WaitUntilVSCHandleIsReady( vs, p.crClient, p.log, @@ -305,6 +305,7 @@ func (p *pvcBackupItemAction) Execute( vs, &pvc, operationID, + vsc, ) if err != nil { dataUploadLog.WithError(err).Error("failed to submit DataUpload") @@ -441,6 +442,7 @@ func newDataUpload( vs *snapshotv1api.VolumeSnapshot, pvc *corev1api.PersistentVolumeClaim, operationID string, + vsc *snapshotv1api.VolumeSnapshotContent, ) *velerov2alpha1.DataUpload { dataUpload := &velerov2alpha1.DataUpload{ TypeMeta: metav1.TypeMeta{ @@ -471,7 +473,7 @@ func newDataUpload( CSISnapshot: &velerov2alpha1.CSISnapshotSpec{ VolumeSnapshot: vs.Name, StorageClass: *pvc.Spec.StorageClassName, - SnapshotClass: *vs.Spec.VolumeSnapshotClassName, + Driver: vsc.Spec.Driver, }, SourcePVC: pvc.Name, DataMover: backup.Spec.DataMover, @@ -481,6 +483,10 @@ func newDataUpload( }, } + if vs.Spec.VolumeSnapshotClassName != nil { + dataUpload.Spec.CSISnapshot.SnapshotClass = *vs.Spec.VolumeSnapshotClassName + } + if backup.Spec.UploaderConfig != nil && backup.Spec.UploaderConfig.ParallelFilesUpload > 0 { dataUpload.Spec.DataMoverConfig = make(map[string]string) @@ -497,8 +503,9 @@ func createDataUpload( vs *snapshotv1api.VolumeSnapshot, pvc *corev1api.PersistentVolumeClaim, operationID string, + vsc *snapshotv1api.VolumeSnapshotContent, ) (*velerov2alpha1.DataUpload, error) { - dataUpload := newDataUpload(backup, vs, pvc, operationID) + dataUpload := newDataUpload(backup, vs, pvc, operationID, vsc) err := crClient.Create(ctx, dataUpload) if err != nil { diff --git a/pkg/backup/actions/csi/pvc_action_test.go b/pkg/backup/actions/csi/pvc_action_test.go index 0dd52de0cb..0bb9a91512 100644 --- a/pkg/backup/actions/csi/pvc_action_test.go +++ b/pkg/backup/actions/csi/pvc_action_test.go @@ -142,26 +142,27 @@ func TestExecute(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(*testing.T) { - crClient := velerotest.NewFakeControllerRuntimeClient(t) logger := logrus.New() logger.Level = logrus.DebugLevel - + objects := make([]runtime.Object, 0) if tc.pvc != nil { - require.NoError(t, crClient.Create(context.Background(), tc.pvc)) + objects = append(objects, tc.pvc) } if tc.pv != nil { - require.NoError(t, crClient.Create(context.Background(), tc.pv)) + objects = append(objects, tc.pv) } if tc.sc != nil { - require.NoError(t, crClient.Create(context.Background(), tc.sc)) + objects = append(objects, tc.sc) } if tc.vsClass != nil { - require.NoError(t, crClient.Create(context.Background(), tc.vsClass)) + objects = append(objects, tc.vsClass) } if tc.resourcePolicy != nil { - require.NoError(t, crClient.Create(context.Background(), tc.resourcePolicy)) + objects = append(objects, tc.resourcePolicy) } + crClient := velerotest.NewFakeControllerRuntimeClient(t, objects...) + pvcBIA := pvcBackupItemAction{ log: logger, crClient: crClient, diff --git a/pkg/backup/actions/csi/volumesnapshot_action.go b/pkg/backup/actions/csi/volumesnapshot_action.go index 595606a397..da9aa391d0 100644 --- a/pkg/backup/actions/csi/volumesnapshot_action.go +++ b/pkg/backup/actions/csi/volumesnapshot_action.go @@ -84,16 +84,15 @@ func (p *volumeSnapshotBackupItemAction) Execute( return nil, nil, "", nil, errors.WithStack(err) } - volumeSnapshotClassName := "" + additionalItems := make([]velero.ResourceIdentifier, 0) if vs.Spec.VolumeSnapshotClassName != nil { - volumeSnapshotClassName = *vs.Spec.VolumeSnapshotClassName - } - - additionalItems := []velero.ResourceIdentifier{ - { - GroupResource: kuberesource.VolumeSnapshotClasses, - Name: volumeSnapshotClassName, - }, + additionalItems = append( + additionalItems, + velero.ResourceIdentifier{ + GroupResource: kuberesource.VolumeSnapshotClasses, + Name: *vs.Spec.VolumeSnapshotClassName, + }, + ) } p.log.Infof("Getting VolumesnapshotContent for Volumesnapshot %s/%s", diff --git a/pkg/backup/actions/csi/volumesnapshot_action_test.go b/pkg/backup/actions/csi/volumesnapshot_action_test.go index a9c6661233..aa1a263973 100644 --- a/pkg/backup/actions/csi/volumesnapshot_action_test.go +++ b/pkg/backup/actions/csi/volumesnapshot_action_test.go @@ -86,6 +86,39 @@ func TestVSExecute(t *testing.T) { }, }, }, + { + name: "VS not have VSClass", + backup: builder.ForBackup("velero", "backup"). + Phase(velerov1api.BackupPhaseInProgress).Result(), + vs: builder.ForVolumeSnapshot("velero", "vs"). + ObjectMeta(builder.WithLabels( + velerov1api.BackupNameLabel, "backup")). + Status(). + BoundVolumeSnapshotContentName("vsc").Result(), + vsc: builder.ForVolumeSnapshotContent("vsc").Status( + &snapshotv1api.VolumeSnapshotContentStatus{ + SnapshotHandle: &snapshotHandle, + }, + ).Result(), + expectedErr: "", + expectedAdditionalItems: []velero.ResourceIdentifier{ + { + GroupResource: kuberesource.VolumeSnapshotContents, + Name: "vsc", + }, + }, + expectedItemToUpdate: []velero.ResourceIdentifier{ + { + GroupResource: kuberesource.VolumeSnapshots, + Namespace: "velero", + Name: "vs", + }, + { + GroupResource: kuberesource.VolumeSnapshotContents, + Name: "vsc", + }, + }, + }, } for _, tc := range tests {