From d7cfc171603cc85711e6d49b6c9cd857f312fc1b Mon Sep 17 00:00:00 2001 From: Florian Bacher Date: Wed, 15 Mar 2023 09:15:22 +0100 Subject: [PATCH] fix: adapted patch for mutating webhook to correctly add release namespace to exclusions (#1044) Signed-off-by: Florian Bacher --- helm/chart/Chart.yaml | 2 +- helm/overlay/kustomization.yaml | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/helm/chart/Chart.yaml b/helm/chart/Chart.yaml index 2fc5f96601..f0a2a61597 100644 --- a/helm/chart/Chart.yaml +++ b/helm/chart/Chart.yaml @@ -27,7 +27,7 @@ annotations: artifacthub.io/operator: "true" artifacthub.io/operatorCapabilities: "Full Lifecycle" -kubeVersion: ">= 1.24.0" +kubeVersion: ">= 1.24.0-0" # A chart can be either an 'application' or a 'library' chart. # # Application charts are a collection of templates that can be packaged into versioned archives diff --git a/helm/overlay/kustomization.yaml b/helm/overlay/kustomization.yaml index 81ec36c9bc..0221bfcab0 100644 --- a/helm/overlay/kustomization.yaml +++ b/helm/overlay/kustomization.yaml @@ -21,5 +21,27 @@ patches: - '{{ .Release.Namespace }}' target: kind: MutatingWebhookConfiguration - name: "(mutating-webhook-configuration)" + name: "(lifecycle-mutating-webhook-configuration)" + + - patch: | + - op: replace + path: '/spec/service/namespace' + value: '{{ .Release.Namespace }}' + - op: replace + path: '/spec/service/name' + value: '{{ include "chart.fullname" . }}-metrics-operator-service' + target: + kind: APIService + name: "(v1beta2.custom.metrics.k8s.io)" + + - patch: | + - op: replace + path: '/spec/service/namespace' + value: '{{ .Release.Namespace }}' + - op: replace + path: '/spec/service/name' + value: '{{ include "chart.fullname" . }}-metrics-operator-service' + target: + kind: APIService + name: "(v1beta1.custom.metrics.k8s.io)"