Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
add another retry
  • Loading branch information
sklarsa committed Jun 21, 2023
commit d0b56be5030d878d7c48ce4c98edeac0fed5cf0d
20 changes: 11 additions & 9 deletions internal/controller/questdbsnapshotschedule_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,18 @@ var _ = Describe("QuestDBSnapshotSchedule Controller", func() {
g.Expect(k8sClient.Update(ctx, sched)).To(Succeed())
}, timeout, interval).Should(Succeed())

By("Setting the status of the latest snapshot to Succeeded")
snapList := &crdv1beta1.QuestDBSnapshotList{}
Expect(k8sClient.List(ctx, snapList, client.InNamespace(sched.Namespace))).Should(Succeed())
Expect(snapList.Items).To(HaveLen(2))
for _, snap := range snapList.Items {
if snap.Status.Phase != crdv1beta1.SnapshotSucceeded {
snap.Status.Phase = crdv1beta1.SnapshotSucceeded
Expect(k8sClient.Status().Update(ctx, &snap)).To(Succeed())
By("Setting the status of all snapshots to Succeeded")
Eventually(func(g Gomega) {

snapList := &crdv1beta1.QuestDBSnapshotList{}
g.Expect(k8sClient.List(ctx, snapList, client.InNamespace(sched.Namespace))).Should(Succeed())
for _, snap := range snapList.Items {
if snap.Status.Phase != crdv1beta1.SnapshotSucceeded {
snap.Status.Phase = crdv1beta1.SnapshotSucceeded
g.Expect(k8sClient.Status().Update(ctx, &snap)).To(Succeed())
}
}
}
}, timeout, interval).Should(Succeed())

By("Forcing a reconcile")
_, err := r.Reconcile(ctx, ctrl.Request{
Expand Down