diff --git a/controller/controller_test.go b/controller/controller_test.go index f0fabffa0c..7e75f9419d 100644 --- a/controller/controller_test.go +++ b/controller/controller_test.go @@ -89,6 +89,7 @@ const ( TestDeploymentName = "test-deployment" TestBackupTarget = "s3://backupbucket@us-east-1/backupstore" + TestBackupTargetName = "default" TestBackupVolumeName = "test-backup-volume-for-restoration" TestBackupName = "test-backup-for-restoration" diff --git a/controller/volume_controller_test.go b/controller/volume_controller_test.go index aff06ea348..7acf277590 100644 --- a/controller/volume_controller_test.go +++ b/controller/volume_controller_test.go @@ -1318,10 +1318,19 @@ func (s *TestSuite) runTestCases(c *C, testCases map[string]*VolumeTestCase) { backupVolume := &longhorn.BackupVolume{ ObjectMeta: metav1.ObjectMeta{ - Name: bvName, + Name: bvName + "-" + TestBackupTargetName, Finalizers: []string{ longhorn.SchemeGroupVersion.Group, }, + Labels: map[string]string{ + types.LonghornLabelBackupTarget: TestBackupTargetName, + types.LonghornLabelBackupVolume: bvName, + }, + }, + Spec: longhorn.BackupVolumeSpec{ + BackupTargetName: TestBackupTargetName, + BackupTargetURL: TestBackupTarget, + VolumeName: bvName, }, Status: longhorn.BackupVolumeStatus{ LastBackupName: bName,