Skip to content

Commit

Permalink
fixup! test: check {primary,secondary}Cleanup don't delete unrelated …
Browse files Browse the repository at this point in the history
…resources
  • Loading branch information
ushitora-anqou committed Feb 18, 2025
1 parent d6919a6 commit 65a1818
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/controller/mantlebackup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,7 @@ var _ = Describe("import", func() {
checkJobExists(ctx, MakeImportJobName(backup2, 0))
checkPVCExists(ctx, MakeDiscardPVCName(backup2))

// The PV for backup2 should not be deleted.
var pv corev1.PersistentVolume
err = k8sClient.Get(
ctx,
Expand All @@ -2151,6 +2152,14 @@ var _ = Describe("import", func() {
)
Expect(err).NotTo(HaveOccurred())
Expect(pv.GetDeletionTimestamp().IsZero()).To(BeTrue())

// the snapshot for backup2 should not be deleted.
snaps, err := mbr.ceph.RBDSnapLs(dummyPoolName, dummyImageName)
Expect(err).NotTo(HaveOccurred())
index := slices.IndexFunc(snaps, func(snap ceph.RBDSnapshot) bool {
return snap.Id == *backup2.Status.SnapID
})
Expect(index).NotTo(Equal(-1))
})
})

Expand Down

0 comments on commit 65a1818

Please sign in to comment.