Skip to content

Commit

Permalink
feat(main): add test webhooks
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Oct 18, 2024
1 parent b65beac commit 377c848
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/v1beta1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ var _ = Describe("Update", func() {
Expect(err.Error()).To(ContainSubstring("clusterID"))
Expect(err.Error()).To(ContainSubstring("immutable"))
})
It("Update Controller Replicas", func() {
aq := initAutoMQ()
err := k8sClient.Create(context.Background(), aq)
Expect(err).To(BeNil())
aq.Spec.Controller.Replicas = 2
err = k8sClient.Update(context.Background(), aq)
Expect(true).To(Equal(errors.IsForbidden(err)))
Expect(err.Error()).To(ContainSubstring("controller.replicas"))
Expect(err.Error()).To(ContainSubstring("immutable"))
})
})

})
Expand Down

0 comments on commit 377c848

Please sign in to comment.