From df65754c543981920b863e5c6101ff68fe35338b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Wed, 28 Jul 2021 15:28:27 +0800 Subject: [PATCH] Control the name of backup used in E2E test to avoid issue on vSphere (#3985) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backup name must be no more than 63 characters otherwise we'll get error on vSphere platform: Failed to create snapshot record: Snapshot.backupdriver.cnsdp.vmware.com \"snap-8945e7df-069e-4f56-aeb5-75b1dd87547f\" is invalid: metadata.labels: Invalid value: \"backup-bsl-e7a1d0f3-2f29-4d80-9184-6214dac91d96-e7a1d0f3-2f29-4d80-9184-6214dac91d96\": must be no more than 63 characters" Signed-off-by: Wenkai Yin(尹文开) --- test/e2e/backup_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/e2e/backup_test.go b/test/e2e/backup_test.go index 7474679e1..b47fdcde3 100644 --- a/test/e2e/backup_test.go +++ b/test/e2e/backup_test.go @@ -122,8 +122,14 @@ func backup_restore_test(useVolumeSnapshots bool) { bsls := []string{"default", additionalBsl} for _, bsl := range bsls { - backupName = fmt.Sprintf("backup-%s-%s", bsl, uuidgen) - restoreName = fmt.Sprintf("restore-%s-%s", bsl, uuidgen) + 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) + } Expect(runKibishiiTests(client, cloudProvider, veleroCLI, veleroNamespace, backupName, restoreName, bsl, useVolumeSnapshots)).To(Succeed(), "Failed to successfully backup and restore Kibishii namespace using BSL %s", bsl)