Skip to content

Commit

Permalink
fix: missing logic in test
Browse files Browse the repository at this point in the history
Signed-off-by: KevFan <[email protected]>
  • Loading branch information
KevFan committed Jan 8, 2025
1 parent 7c632a8 commit 182d753
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/common/tlspolicy/tlspolicy_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ var _ = Describe("TLSPolicy controller", func() {
Expect(k8sClient.Create(ctx, cert)).To(Succeed())

gateway = tests.NewGatewayBuilder("test-gateway", gatewayClass.Name, testNamespace).
WithHTTPListener("test-listener", "test.example.com").Gateway
Expect(k8sClient.Create(ctx, gateway)).To(BeNil())
WithHTTPSListener("test1.example.com", "test1-tls-secret").Gateway
Expect(k8sClient.Create(ctx, gateway)).To(Succeed())
})

It("Should not delete unmanaged cert", func(ctx context.Context) {
Expand All @@ -1063,7 +1063,7 @@ var _ = Describe("TLSPolicy controller", func() {
tlsPolicy = kuadrantv1.NewTLSPolicy("test-tls-policy", testNamespace).
WithTargetGateway(gateway.Name).
WithIssuerRef(*issuerRef)
Expect(k8sClient.Create(ctx, tlsPolicy)).To(BeNil())
Expect(k8sClient.Create(ctx, tlsPolicy)).To(Succeed())

Eventually(func(g Gomega) {
g.Expect(k8sClient.List(ctx, certList, &client.ListOptions{Namespace: testNamespace})).To(Succeed())
Expand All @@ -1072,8 +1072,7 @@ var _ = Describe("TLSPolicy controller", func() {
HaveField("Name", "unmanaged-cert"),
HaveField("Name", "test-gateway-test1.example.com"),
))
})

}).WithContext(ctx).Should(Succeed())
}, testTimeOut)
})
})

0 comments on commit 182d753

Please sign in to comment.