Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions tests/e2e/backup_restore_cli_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
21 changes: 12 additions & 9 deletions tests/e2e/backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down