From 96a0859ac731ca64aee726b7c346f5b34cd9a153 Mon Sep 17 00:00:00 2001 From: Anton Johansson Date: Wed, 28 Apr 2021 12:46:47 +0200 Subject: [PATCH] Add support to allow CRD conversion webhooks from outside of the cluster Related to #3876 Signed-off-by: Anton Johansson --- deploy/crds/crd-certificaterequests.yaml | 8 ++++++-- deploy/crds/crd-certificates.yaml | 8 ++++++-- deploy/crds/crd-challenges.yaml | 8 ++++++-- deploy/crds/crd-clusterissuers.yaml | 8 ++++++-- deploy/crds/crd-issuers.yaml | 8 ++++++-- deploy/crds/crd-orders.yaml | 8 ++++++-- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/deploy/crds/crd-certificaterequests.yaml b/deploy/crds/crd-certificaterequests.yaml index d01182284..6a05b86ec 100644 --- a/deploy/crds/crd-certificaterequests.yaml +++ b/deploy/crds/crd-certificaterequests.yaml @@ -30,10 +30,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - name: v1alpha2 subresources: diff --git a/deploy/crds/crd-certificates.yaml b/deploy/crds/crd-certificates.yaml index 520316e6f..69c04c50d 100644 --- a/deploy/crds/crd-certificates.yaml +++ b/deploy/crds/crd-certificates.yaml @@ -30,10 +30,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - name: v1alpha2 subresources: diff --git a/deploy/crds/crd-challenges.yaml b/deploy/crds/crd-challenges.yaml index 5336cfc8d..3207576bf 100644 --- a/deploy/crds/crd-challenges.yaml +++ b/deploy/crds/crd-challenges.yaml @@ -28,10 +28,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - additionalPrinterColumns: - jsonPath: .status.state diff --git a/deploy/crds/crd-clusterissuers.yaml b/deploy/crds/crd-clusterissuers.yaml index 2301c2147..0f830a713 100644 --- a/deploy/crds/crd-clusterissuers.yaml +++ b/deploy/crds/crd-clusterissuers.yaml @@ -27,10 +27,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - name: v1alpha2 subresources: diff --git a/deploy/crds/crd-issuers.yaml b/deploy/crds/crd-issuers.yaml index d02735523..fa2253773 100644 --- a/deploy/crds/crd-issuers.yaml +++ b/deploy/crds/crd-issuers.yaml @@ -27,10 +27,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - name: v1alpha2 subresources: diff --git a/deploy/crds/crd-orders.yaml b/deploy/crds/crd-orders.yaml index fe473aa22..f649ba538 100644 --- a/deploy/crds/crd-orders.yaml +++ b/deploy/crds/crd-orders.yaml @@ -28,10 +28,14 @@ spec: webhook: conversionReviewVersions: ["v1", "v1beta1"] clientConfig: + {{- if .Values.webhook.url.host }} + url: https://{{ .Values.webhook.url.host }}/convert + {{- else }} service: - namespace: '{{ .Release.Namespace }}' - name: '{{ template "webhook.fullname" . }}' + name: {{ template "webhook.fullname" . }} + namespace: {{ .Release.Namespace | quote }} path: /convert + {{- end }} versions: - name: v1alpha2 subresources: