Merge pull request #3519 from meyskens/rm-webhook-helm-hack

Remove Helm hack for webhook API versions
This commit is contained in:
jetstack-bot 2020-12-17 17:48:41 +00:00 committed by GitHub
commit 7cef4582ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 31 deletions

View File

@ -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 }}

View File

@ -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 }}