From a6477695618ad0449d9d773c8dd0dc21ab34863b Mon Sep 17 00:00:00 2001 From: Wesley Hayutin Date: Tue, 24 Mar 2026 11:43:20 -0600 Subject: [PATCH] Disable pod restart workaround after file-system restore Comment out the KOPIA post-restore pod deletion to test whether the OVN-Kubernetes networking workaround is still required. If E2E tests pass without it, this workaround can be removed entirely. Made-with: Cursor --- tests/e2e/backup_restore_cli_suite_test.go | 21 ++++++++++++--------- tests/e2e/backup_restore_suite_test.go | 21 ++++++++++++--------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/tests/e2e/backup_restore_cli_suite_test.go b/tests/e2e/backup_restore_cli_suite_test.go index b87079fa0b3..0b54539f99d 100644 --- a/tests/e2e/backup_restore_cli_suite_test.go +++ b/tests/e2e/backup_restore_cli_suite_test.go @@ -175,20 +175,23 @@ func runApplicationBackupAndRestoreViaCLI(brCase ApplicationBackupRestoreCase, u // run restore via CLI runRestoreViaCLI(brCase.BackupRestoreCase, backupName, restoreName, nsRequiredResticDCWorkaround) + // TODO: Testing whether this workaround is still needed. Remove if + // file-system restore tests pass without it. + // // For file-system backup restores (KOPIA/restic), the restored pods may have // broken networking because OVN-Kubernetes doesn't fully wire the network // namespace for pods recreated by Velero with a restore-wait init container. // Deleting the pods lets the deployment controller create fresh ones with // proper networking while preserving the restored PVC data. - if brCase.BackupRestoreType == lib.KOPIA { - log.Printf("Restarting pods in namespace %s to ensure proper networking after file-system restore", brCase.Namespace) - err = kubernetesClientForSuiteRun.CoreV1().Pods(brCase.Namespace).DeleteCollection( - context.Background(), - metav1.DeleteOptions{}, - metav1.ListOptions{LabelSelector: "e2e-app=true"}, - ) - gomega.Expect(err).ToNot(gomega.HaveOccurred()) - } + // if brCase.BackupRestoreType == lib.KOPIA { + // log.Printf("Restarting pods in namespace %s to ensure proper networking after file-system restore", brCase.Namespace) + // err = kubernetesClientForSuiteRun.CoreV1().Pods(brCase.Namespace).DeleteCollection( + // context.Background(), + // metav1.DeleteOptions{}, + // metav1.ListOptions{LabelSelector: "e2e-app=true"}, + // ) + // gomega.Expect(err).ToNot(gomega.HaveOccurred()) + // } // Run optional custom verification if brCase.PostRestoreVerify != nil { diff --git a/tests/e2e/backup_restore_suite_test.go b/tests/e2e/backup_restore_suite_test.go index 09090da4fbf..8b1f5d53312 100644 --- a/tests/e2e/backup_restore_suite_test.go +++ b/tests/e2e/backup_restore_suite_test.go @@ -266,20 +266,23 @@ func runApplicationBackupAndRestore(brCase ApplicationBackupRestoreCase, updateL // run restore runRestore(brCase.BackupRestoreCase, backupName, restoreName, nsRequiredResticDCWorkaround) + // TODO: Testing whether this workaround is still needed. Remove if + // file-system restore tests pass without it. + // // For file-system backup restores (KOPIA/restic), the restored pods may have // broken networking because OVN-Kubernetes doesn't fully wire the network // namespace for pods recreated by Velero with a restore-wait init container. // Deleting the pods lets the deployment controller create fresh ones with // proper networking while preserving the restored PVC data. - if brCase.BackupRestoreType == lib.KOPIA { - log.Printf("Restarting pods in namespace %s to ensure proper networking after file-system restore", brCase.Namespace) - err = kubernetesClientForSuiteRun.CoreV1().Pods(brCase.Namespace).DeleteCollection( - context.Background(), - metav1.DeleteOptions{}, - metav1.ListOptions{LabelSelector: "e2e-app=true"}, - ) - gomega.Expect(err).ToNot(gomega.HaveOccurred()) - } + // if brCase.BackupRestoreType == lib.KOPIA { + // log.Printf("Restarting pods in namespace %s to ensure proper networking after file-system restore", brCase.Namespace) + // err = kubernetesClientForSuiteRun.CoreV1().Pods(brCase.Namespace).DeleteCollection( + // context.Background(), + // metav1.DeleteOptions{}, + // metav1.ListOptions{LabelSelector: "e2e-app=true"}, + // ) + // gomega.Expect(err).ToNot(gomega.HaveOccurred()) + // } // Run optional custom verification if brCase.PostRestoreVerify != nil {