Remove webhook for setup key resource (#148)

The webhook for the NBSetupKey does a mix of runtime validation and
configuration validation. The validation of secret key ref has been
switched to using CEL rules to achieve the same thing.

The other logic is just being removed as it is goes against common
practice in Kubernetes. We should not block secret deletion if a pod is
using the secret. Existing pods will keep running while new pods will
not be able to be created. This is expected behavior in other tools and
should be dealt with during reconcile.

Checking that secrets exist and other dependency problems should be done
during reconcile and then bubbled up with conditions instead.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-03-19 15:48:38 +01:00
committed by GitHub
parent 7acd175882
commit e83dc472e2
8 changed files with 7 additions and 376 deletions
-14
View File
@@ -264,20 +264,6 @@ var _ = Describe("Manager", Ordered, func() {
Eventually(verifyCAInjection).Should(Succeed())
})
It("should have CA injection for validating webhooks", func() {
By("checking CA injection for validating webhooks")
verifyCAInjection := func(g Gomega) {
cmd := exec.Command("kubectl", "get",
"validatingwebhookconfigurations.admissionregistration.k8s.io",
"kubernetes-operator-vnbsetupkey-webhook",
"-o", "go-template={{ range .webhooks }}{{ .clientConfig.caBundle }}{{ end }}")
vwhOutput, err := utils.Run(cmd)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(len(vwhOutput)).To(BeNumerically(">", 10))
}
Eventually(verifyCAInjection).Should(Succeed())
})
Context("NBSetupKey", Ordered, func() {
Describe("Basic functionality", Ordered, func() {
BeforeAll(func() {