Skip to content

Commit

Permalink
Merge pull request #815 from olliewalsh/custom_ca_test_fix
Browse files Browse the repository at this point in the history
Ensure default issuer already exists before running custom issuer tests
  • Loading branch information
openshift-merge-bot[bot] authored May 28, 2024
2 parents b68cb4a + 79e910f commit 6daae48
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/functional/openstackoperator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,13 @@ var _ = Describe("OpenStackOperator controller", func() {

When("The TLSe OpenStackControlplane instance switches to use a custom public issuer", func() {
BeforeEach(func() {
// wait for default issuer
Eventually(func(g Gomega) {
issuer := crtmgr.GetIssuer(names.RootCAPublicName)
g.Expect(issuer).Should(Not(BeNil()))
g.Expect(issuer.Labels).Should(HaveKey(certmanager.RootCAIssuerPublicLabel))
}, timeout, interval).Should(Succeed())

// create custom issuer
DeferCleanup(k8sClient.Delete, ctx, crtmgr.CreateIssuer(names.CustomIssuerName))
DeferCleanup(k8sClient.Delete, ctx, CreateCertSecret(names.CustomIssuerName))
Expand Down Expand Up @@ -971,15 +978,15 @@ var _ = Describe("OpenStackOperator controller", func() {
}, timeout, interval).Should(Succeed())
})

It("should remove the certmanager.RootCAIssuerPublicLabel label from the defaultIssuer", func() {
It("should add the certmanager.RootCAIssuerPublicLabel label to the defaultIssuer", func() {
Eventually(func(g Gomega) {
issuer := crtmgr.GetIssuer(names.RootCAPublicName)
g.Expect(issuer).Should(Not(BeNil()))
g.Expect(issuer.Labels).Should(HaveKey(certmanager.RootCAIssuerPublicLabel))
}, timeout, interval).Should(Succeed())
})

It("should add the certmanager.RootCAIssuerPublicLabel label to the customIssuer", func() {
It("should remove the certmanager.RootCAIssuerPublicLabel label from the customIssuer", func() {
Eventually(func(g Gomega) {
issuer := crtmgr.GetIssuer(names.CustomIssuerName)
g.Expect(issuer).Should(Not(BeNil()))
Expand Down

0 comments on commit 6daae48

Please sign in to comment.