Skip to content

Commit 73da247

Browse files
author
Milla Samuel
committed
Delete backup resource
1 parent 31e4525 commit 73da247

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

e2e/fixtures/fdb_backup.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,16 @@ func (fdbBackup *FdbBackup) GetBackupPods() *corev1.PodList {
254254

255255
return podList
256256
}
257+
258+
// DeleteBackup will stop and delete the backup resource.
259+
func (fdbBackup *FdbBackup) DeleteBackup() {
260+
if fdbBackup == nil {
261+
return
262+
}
263+
264+
// First stop the backup
265+
fdbBackup.Stop()
266+
267+
// Then delete the backup resource
268+
fdbBackup.fdbCluster.factory.Delete(fdbBackup.backup)
269+
}

e2e/test_operator_backups/operator_backup_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
8686
})
8787

8888
AfterEach(func() {
89-
backup.Stop()
89+
backup.DeleteBackup()
9090
log.Println("deleting backup")
91-
factory.Delete(backup.GetBackupPod())
9291
backup = nil
9392
})
9493

0 commit comments

Comments
 (0)