Skip to content

Commit

Permalink
frontend controller
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrdrew committed Nov 6, 2023
1 parent e321d51 commit cecb96c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions controllers/frontend_controller_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,21 @@ var _ = ginkgo.Describe("Frontend controller with service", func() {
if err != nil {
return false
}
gomega.Expect(nfe.Status.Conditions[0].Type).Should(gomega.Equal(crd.FrontendsReady))
gomega.Expect(nfe.Status.Conditions[0].Status).Should(gomega.Equal(v1.ConditionTrue))
gomega.Expect(nfe.Status.Conditions[1].Type).Should(gomega.Equal(crd.ReconciliationFailed))
gomega.Expect(nfe.Status.Conditions[1].Status).Should(gomega.Equal(v1.ConditionFalse))
gomega.Expect(nfe.Status.Conditions[2].Type).Should(gomega.Equal(crd.ReconciliationSuccessful))
gomega.Expect(nfe.Status.Conditions[2].Status).Should(gomega.Equal(v1.ConditionTrue))
gomega.Expect(nfe.Status.Ready).Should(gomega.Equal(true))
return true

// Check the length of Conditions slice before accessing by index
if len(nfe.Status.Conditions) > 2 {
gomega.Expect(nfe.Status.Conditions[0].Type).Should(gomega.Equal(crd.FrontendsReady))
gomega.Expect(nfe.Status.Conditions[0].Status).Should(gomega.Equal(v1.ConditionTrue))
gomega.Expect(nfe.Status.Conditions[1].Type).Should(gomega.Equal(crd.ReconciliationFailed))
gomega.Expect(nfe.Status.Conditions[1].Status).Should(gomega.Equal(v1.ConditionFalse))
gomega.Expect(nfe.Status.Conditions[2].Type).Should(gomega.Equal(crd.ReconciliationSuccessful))
gomega.Expect(nfe.Status.Conditions[2].Status).Should(gomega.Equal(v1.ConditionTrue))
gomega.Expect(nfe.Status.Ready).Should(gomega.Equal(true))
return true
}
return false
}, timeout, interval).Should(gomega.BeTrue())

})
})
})
Expand Down

0 comments on commit cecb96c

Please sign in to comment.