From f00ad306bbfdea32975c241a5c820ac0cb3101e8 Mon Sep 17 00:00:00 2001 From: danfengl Date: Sat, 18 Sep 2021 14:32:26 +0000 Subject: [PATCH] Recovery the workround for aws pending issue Signed-off-by: danfengl --- test/e2e/kibishii_utils.go | 8 ++++++++ test/e2e/upgrade_test.go | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/test/e2e/kibishii_utils.go b/test/e2e/kibishii_utils.go index 1784ada59..b8efc35c1 100644 --- a/test/e2e/kibishii_utils.go +++ b/test/e2e/kibishii_utils.go @@ -68,6 +68,14 @@ func runKibishiiTests(client testClient, providerName, veleroCLI, veleroNamespac return errors.Wrapf(err, "failed to delete namespace %s", kibishiiNamespace) } + // the snapshots of AWS may be still in pending status when do the restore, wait for a while + // to avoid this https://github.com/vmware-tanzu/velero/issues/1799 + // TODO remove this after https://github.com/vmware-tanzu/velero/issues/3533 is fixed + if providerName == "aws" && useVolumeSnapshots { + fmt.Println("Waiting 5 minutes to make sure the snapshots are ready...") + time.Sleep(5 * time.Minute) + } + if err := veleroRestore(oneHourTimeout, veleroCLI, veleroNamespace, restoreName, backupName); err != nil { runDebug(context.Background(), veleroCLI, veleroNamespace, "", restoreName) return errors.Wrapf(err, "Restore %s failed from backup %s", restoreName, backupName) diff --git a/test/e2e/upgrade_test.go b/test/e2e/upgrade_test.go index ae82a3a34..2a9ae9d22 100644 --- a/test/e2e/upgrade_test.go +++ b/test/e2e/upgrade_test.go @@ -134,6 +134,15 @@ func runUpgradeTests(client testClient, upgradeToVeleroImage, upgradeToVeleroVer if err := deleteNamespace(oneHourTimeout, client, upgradeNamespace, true); err != nil { return errors.Wrapf(err, "failed to delete namespace %s", upgradeNamespace) } + + // the snapshots of AWS may be still in pending status when do the restore, wait for a while + // to avoid this https://github.com/vmware-tanzu/velero/issues/1799 + // TODO remove this after https://github.com/vmware-tanzu/velero/issues/3533 is fixed + if providerName == "aws" && useVolumeSnapshots { + fmt.Println("Waiting 5 minutes to make sure the snapshots are ready...") + time.Sleep(5 * time.Minute) + } + if err := veleroInstall(context.Background(), veleroCLI, upgradeToVeleroImage, resticHelperImage, veleroNamespace, cloudProvider, objectStoreProvider, useVolumeSnapshots, cloudCredentialsFile, bslBucket, bslPrefix, bslConfig, vslConfig, crdsVersion, "", registryCredentialFile); err != nil { return errors.Wrapf(err, "Failed to install velero from image %s", upgradeToVeleroImage)