mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Fix [Basic][Snapshot] failure on AddintionalBSL case.
It failed with fetching the wrong VolumeInfo. Correct it. Add AdditionalBSL label for applied cases. Remove not needed default BSL kibishii test for additional bsl case. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
committed by
Xun Jiang/Bruce Jiang
parent
6085044de2
commit
ce09996854
@@ -26,6 +26,7 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
. "github.com/vmware-tanzu/velero/test"
|
||||
"github.com/vmware-tanzu/velero/test/util/common"
|
||||
. "github.com/vmware-tanzu/velero/test/util/k8s"
|
||||
. "github.com/vmware-tanzu/velero/test/util/kibishii"
|
||||
. "github.com/vmware-tanzu/velero/test/util/velero"
|
||||
@@ -194,11 +195,10 @@ func BackupRestoreTest(backupRestoreTestConfig BackupRestoreTestConfig) {
|
||||
Expect(CreateSecretFromFiles(context.TODO(), *veleroCfg.ClientToInstallVelero, veleroCfg.VeleroNamespace, secretName, files)).To(Succeed())
|
||||
|
||||
// Create additional BSL using credential
|
||||
additionalBsl := "add-bsl"
|
||||
Expect(VeleroCreateBackupLocation(context.TODO(),
|
||||
veleroCfg.VeleroCLI,
|
||||
veleroCfg.VeleroNamespace,
|
||||
additionalBsl,
|
||||
common.AdditionalBSLName,
|
||||
veleroCfg.AdditionalBSLProvider,
|
||||
veleroCfg.AdditionalBSLBucket,
|
||||
veleroCfg.AdditionalBSLPrefix,
|
||||
@@ -207,32 +207,25 @@ func BackupRestoreTest(backupRestoreTestConfig BackupRestoreTestConfig) {
|
||||
secretKey,
|
||||
)).To(Succeed())
|
||||
|
||||
BSLs := []string{"default", additionalBsl}
|
||||
|
||||
for _, bsl := range BSLs {
|
||||
backupName = fmt.Sprintf("backup-%s", bsl)
|
||||
restoreName = fmt.Sprintf("restore-%s", bsl)
|
||||
// We limit the length of backup name here to avoid the issue of vsphere plugin https://github.com/vmware-tanzu/velero-plugin-for-vsphere/issues/370
|
||||
// We can remove the logic once the issue is fixed
|
||||
if bsl == "default" {
|
||||
backupName = fmt.Sprintf("%s-%s", backupName, UUIDgen)
|
||||
restoreName = fmt.Sprintf("%s-%s", restoreName, UUIDgen)
|
||||
}
|
||||
veleroCfg.ProvideSnapshotsVolumeParam = !provideSnapshotVolumesParmInBackup
|
||||
workloadNS := kibishiiNamespace + bsl
|
||||
Expect(
|
||||
RunKibishiiTests(
|
||||
veleroCfg,
|
||||
backupName,
|
||||
restoreName,
|
||||
bsl,
|
||||
workloadNS,
|
||||
useVolumeSnapshots,
|
||||
!useVolumeSnapshots,
|
||||
),
|
||||
).To(Succeed(),
|
||||
"Failed to successfully backup and restore Kibishii namespace using BSL %s", bsl)
|
||||
}
|
||||
// We limit the length of backup name here to avoid the issue of vsphere plugin
|
||||
// https://github.com/vmware-tanzu/velero-plugin-for-vsphere/issues/370
|
||||
// We can remove the logic once the issue is fixed
|
||||
backupName = "backup-" + common.AdditionalBSLName
|
||||
restoreName = "restore-" + common.AdditionalBSLName
|
||||
veleroCfg.ProvideSnapshotsVolumeParam = !provideSnapshotVolumesParmInBackup
|
||||
workloadNS := kibishiiNamespace + common.AdditionalBSLName
|
||||
Expect(
|
||||
RunKibishiiTests(
|
||||
veleroCfg,
|
||||
backupName,
|
||||
restoreName,
|
||||
common.AdditionalBSLName,
|
||||
workloadNS,
|
||||
useVolumeSnapshots,
|
||||
!useVolumeSnapshots,
|
||||
),
|
||||
).To(Succeed(),
|
||||
"Failed to successfully backup and restore Kibishii namespace with additional BSL %s", common.AdditionalBSLName)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -398,25 +398,25 @@ var _ = Describe(
|
||||
// Test backup and restore of Kibishii using restic
|
||||
var _ = Describe(
|
||||
"Velero tests on cluster using the plugin provider for object storage and Restic for volume backups",
|
||||
Label("Basic", "Restic"),
|
||||
Label("Basic", "Restic", "AdditionalBSL"),
|
||||
BackupRestoreWithRestic,
|
||||
)
|
||||
|
||||
var _ = Describe(
|
||||
"Velero tests on cluster using the plugin provider for object storage and snapshots for volume backups",
|
||||
Label("Basic", "Snapshot", "SkipVanillaZfs"),
|
||||
Label("Basic", "Snapshot", "SkipVanillaZfs", "AdditionalBSL"),
|
||||
BackupRestoreWithSnapshots,
|
||||
)
|
||||
|
||||
var _ = Describe(
|
||||
"Velero tests on cluster using the plugin provider for object storage and snapshots for volume backups",
|
||||
Label("Basic", "Snapshot", "RetainPV"),
|
||||
Label("Basic", "Snapshot", "RetainPV", "AdditionalBSL"),
|
||||
BackupRestoreRetainedPVWithSnapshots,
|
||||
)
|
||||
|
||||
var _ = Describe(
|
||||
"Velero tests on cluster using the plugin provider for object storage and snapshots for volume backups",
|
||||
Label("Basic", "Restic", "RetainPV"),
|
||||
Label("Basic", "Restic", "RetainPV", "AdditionalBSL"),
|
||||
BackupRestoreRetainedPVWithRestic,
|
||||
)
|
||||
|
||||
@@ -597,12 +597,12 @@ var _ = Describe(
|
||||
|
||||
var _ = Describe(
|
||||
"Local backups will be deleted once the corresponding backup storage location is deleted",
|
||||
Label("BSL", "Deletion", "Snapshot", "SkipVanillaZfs"),
|
||||
Label("BSL", "Deletion", "Snapshot", "SkipVanillaZfs", "AdditionalBSL"),
|
||||
BslDeletionWithSnapshots,
|
||||
)
|
||||
var _ = Describe(
|
||||
"Local backups and Restic repos will be deleted once the corresponding backup storage location is deleted",
|
||||
Label("BSL", "Deletion", "Restic"),
|
||||
Label("BSL", "Deletion", "Restic", "AdditionalBSL"),
|
||||
BslDeletionWithRestic,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user