Merge pull request #3519 from meyskens/rm-webhook-helm-hack
Remove Helm hack for webhook API versions
This commit is contained in:
commit
7cef4582ec
@ -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 }}
|
||||
|
||||
@ -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 }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user