From a6d499efdb1e3538c578cdb12b1d171c004e7de4 Mon Sep 17 00:00:00 2001 From: Marcelo Guerrero Date: Tue, 20 Jun 2023 13:16:45 +0200 Subject: [PATCH 1/2] Add sriovoperatorconfigs resource to webhook The sriovoperatorconfigs resource was not present in the validating webhook configuration. The logic to validate this object was not triggered. Signed-off-by: Marcelo Guerrero --- bindata/manifests/operator-webhook/003-webhook.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindata/manifests/operator-webhook/003-webhook.yaml b/bindata/manifests/operator-webhook/003-webhook.yaml index eb21121ef..b725e466f 100644 --- a/bindata/manifests/operator-webhook/003-webhook.yaml +++ b/bindata/manifests/operator-webhook/003-webhook.yaml @@ -57,3 +57,7 @@ webhooks: apiGroups: ["sriovnetwork.openshift.io"] apiVersions: ["v1"] resources: ["sriovnetworknodepolicies"] + - operations: [ "CREATE", "UPDATE", "DELETE" ] + apiGroups: [ "sriovnetwork.openshift.io" ] + apiVersions: [ "v1" ] + resources: [ "sriovoperatorconfigs" ] From 92621265b986d385dc85002c07c5c45ede38f505 Mon Sep 17 00:00:00 2001 From: Marcelo Guerrero Date: Sat, 1 Jul 2023 02:01:07 +0200 Subject: [PATCH 2/2] Disable webhooks in api server of envtest The operatorconfig controller tests were broken due to the validating webhook. Signed-off-by: Marcelo Guerrero --- controllers/suite_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 9bd666ae7..3d534695f 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -75,6 +75,8 @@ var _ = BeforeSuite(func(done Done) { ErrorIfCRDPathMissing: true, } + testEnv.ControlPlane.GetAPIServer().Configure().Set("disable-admission-plugins", "MutatingAdmissionWebhook", "ValidatingAdmissionWebhook") + cfg, err := testEnv.Start() Expect(err).NotTo(HaveOccurred()) Expect(cfg).NotTo(BeNil())