From f05f8aa8129bde6bf093853c04fa88c4b8170ef1 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Tue, 1 Oct 2024 13:16:30 +0200 Subject: [PATCH] fix: do not exit when k8s' matchConditions are not available Do not exit with an error when the `matchConditions` field is not available for ValidatingWebhookConfiguration and MutatingWebhookConfiguration. The code is already structured to work when this feature is not available, hence we don't have to cause the controller to exit with an error. Fixes https://github.com/kubewarden/kubewarden-controller/issues/900 Signed-off-by: Flavio Castelli --- cmd/main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index ccfd7790..aac443bf 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -138,8 +138,6 @@ func main() { featureGateAdmissionWebhookMatchConditions, err := featuregates.CheckAdmissionWebhookMatchConditions(ctrl.GetConfigOrDie()) if err != nil { setupLog.Error(err, "unable to check for feature gate AdmissionWebhookMatchConditions") - retcode = 1 - return } if err = setupReconcilers(mgr, deploymentsNamespace, webhookServiceName, enableMetrics, enableTracing, alwaysAcceptAdmissionReviewsOnDeploymentsNamespace, featureGateAdmissionWebhookMatchConditions); err != nil {