diff --git a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml index 56ff07b74..99309c0ee 100644 --- a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml @@ -1,10 +1,4 @@ -{{- $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/force-v1beta1-webhooks") ) }} -apiVersion: admissionregistration.k8s.io/v1beta1 -{{- else }} -{{- $isV1AdmissionRegistration = true -}} apiVersion: admissionregistration.k8s.io/v1 -{{- end }} kind: MutatingWebhookConfiguration metadata: name: {{ include "webhook.fullname" . }} @@ -33,21 +27,12 @@ webhooks: - UPDATE resources: - "*/*" - {{- if $isV1AdmissionRegistration }} admissionReviewVersions: ["v1", "v1beta1"] timeoutSeconds: {{ .Values.webhook.timeoutSeconds }} - {{- end }} failurePolicy: Fail -{{- if (semverCompare ">=1.12-0" .Capabilities.KubeVersion.GitVersion) }} # Only include 'sideEffects' field in Kubernetes 1.12+ sideEffects: None -{{- end }} clientConfig: -{{- if (semverCompare "<=1.12-0" .Capabilities.KubeVersion.GitVersion) }} - # Set caBundle to empty to avoid https://github.com/kubernetes/kubernetes/pull/70138 - # in Kubernetes 1.12 and below. - caBundle: "" -{{- end }} service: name: {{ template "webhook.fullname" . }} namespace: {{ .Release.Namespace | quote }} diff --git a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml index c45461e05..64c8d73da 100644 --- a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml @@ -1,10 +1,4 @@ -{{- $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/force-v1beta1-webhooks") ) }} -apiVersion: admissionregistration.k8s.io/v1beta1 -{{- else }} -{{- $isV1AdmissionRegistration = true -}} apiVersion: admissionregistration.k8s.io/v1 -{{- end }} kind: ValidatingWebhookConfiguration metadata: name: {{ include "webhook.fullname" . }} @@ -43,21 +37,11 @@ webhooks: - UPDATE resources: - "*/*" - {{- if $isV1AdmissionRegistration }} admissionReviewVersions: ["v1", "v1beta1"] timeoutSeconds: {{ .Values.webhook.timeoutSeconds }} - {{- end }} failurePolicy: Fail -{{- if (semverCompare ">=1.12-0" .Capabilities.KubeVersion.GitVersion) }} - # Only include 'sideEffects' field in Kubernetes 1.12+ sideEffects: None -{{- end }} clientConfig: -{{- if (semverCompare "<=1.12-0" .Capabilities.KubeVersion.GitVersion) }} - # Set caBundle to empty to avoid https://github.com/kubernetes/kubernetes/pull/70138 - # in Kubernetes 1.12 and below. - caBundle: "" -{{- end }} service: name: {{ template "webhook.fullname" . }} namespace: {{ .Release.Namespace | quote }}