diff --git a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml index 494aaf02f..b02e19679 100644 --- a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml @@ -1,5 +1,5 @@ {{- $isV1AdmissionRegistration := false -}} -{{- if (or (not (.Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1")) (.Capabilities.APIVersions.Has "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/use-v1beta1-webhooks") ) }} +{{- if (or (not (.Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1")) (.Capabilities.APIVersions.Has "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/force-v1beta1-webhooks") ) }} apiVersion: admissionregistration.k8s.io/v1beta1 {{- else }} {{- $isV1AdmissionRegistration = true -}} diff --git a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml index be7952a10..77d7526bc 100644 --- a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml @@ -1,5 +1,5 @@ {{- $isV1AdmissionRegistration := false -}} -{{- if (or (not (.Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1")) (.Capabilities.APIVersions.Has "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/use-v1beta1-webhooks") ) }} +{{- if (or (not (.Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1")) (.Capabilities.APIVersions.Has "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/force-v1beta1-webhooks") ) }} apiVersion: admissionregistration.k8s.io/v1beta1 {{- else }} {{- $isV1AdmissionRegistration = true -}} diff --git a/deploy/manifests/BUILD.bazel b/deploy/manifests/BUILD.bazel index d9d7aa1c4..e4379f3d3 100644 --- a/deploy/manifests/BUILD.bazel +++ b/deploy/manifests/BUILD.bazel @@ -20,7 +20,12 @@ VARIANTS = { }, "cert-manager-legacy": { "crd_variant": "legacy", - "additional_api_versions": "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/use-v1beta1-webhooks", + # This following line tells Helm that we need to use v1beta1 webhooks + # When using helm template the API versions are determined for the version + # helm was compiled with, there is no way to remove any from this list + # the following hack adds an API version which we then can use to force + # the template engine to use v1beta1 webhooks. + "additional_api_versions": "hacking-helm.i-wish-this-wasnt-required.cert-manager.io/force-v1beta1-webhooks", "values": { "installCRDs": "false", },