From 48097d5ddf1e804ba75ea360f66c43bcc9637bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Wed, 16 Apr 2025 15:43:16 +0200 Subject: [PATCH] well-known: use helpers for configmap data and drop chart version from pod labels --- .../templates/well-known/_helpers.tpl | 16 +++++++++++++++- .../templates/well-known/configmap.yaml | 9 +-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/charts/matrix-stack/templates/well-known/_helpers.tpl b/charts/matrix-stack/templates/well-known/_helpers.tpl index 8c9f697b..acb51b65 100644 --- a/charts/matrix-stack/templates/well-known/_helpers.tpl +++ b/charts/matrix-stack/templates/well-known/_helpers.tpl @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only app.kubernetes.io/component: matrix-delegation app.kubernetes.io/name: well-known-delegation app.kubernetes.io/instance: {{ $root.Release.Name }}-well-known-delegation -app.kubernetes.io/version: {{ $root.Chart.Version }} +app.kubernetes.io/version: {{ $root.Values.haproxy.image.tag }} {{- end }} {{- end }} @@ -86,3 +86,17 @@ k8s.element.io/target-instance: {{ $root.Release.Name }}-haproxy {{- tpl (toPrettyJson (merge $config $additional)) $root -}} {{- end -}} {{- end }} + +{{- define "element-io.well-known-delegation.configmap-data" -}} +{{- $root := .root -}} +{{- with required "element-io.well-known-delegation.configmap-data missing context" .context -}} +client: | + {{ (tpl (include "element-io.well-known-delegation.client" (dict "root" $root "context" .)) $root) | nindent 2 }} +server: | + {{ (tpl (include "element-io.well-known-delegation.server" (dict "root" $root "context" .)) $root) | nindent 2 }} +support: | + {{ (tpl (include "element-io.well-known-delegation.support" (dict "root" $root "context" .)) $root) | nindent 2 }} +element.json: | + {{ (tpl (include "element-io.well-known-delegation.element" (dict "root" $root "context" .)) $root) | nindent 2 }} +{{- end -}} +{{- end -}} diff --git a/charts/matrix-stack/templates/well-known/configmap.yaml b/charts/matrix-stack/templates/well-known/configmap.yaml index 6476e58b..c8bcc009 100644 --- a/charts/matrix-stack/templates/well-known/configmap.yaml +++ b/charts/matrix-stack/templates/well-known/configmap.yaml @@ -14,13 +14,6 @@ metadata: name: {{ $.Release.Name }}-well-known-haproxy namespace: {{ $.Release.Namespace }} data: - client: | - {{ (tpl (include "element-io.well-known-delegation.client" (dict "root" $ "context" .)) $) | nindent 4 }} - server: | - {{ (tpl (include "element-io.well-known-delegation.server" (dict "root" $ "context" .)) $) | nindent 4 }} - support: | - {{ (tpl (include "element-io.well-known-delegation.support" (dict "root" $ "context" .)) $) | nindent 4 }} - element.json: | - {{ (tpl (include "element-io.well-known-delegation.element" (dict "root" $ "context" .)) $) | nindent 4 }} + {{- include "element-io.well-known-delegation.configmap-data" (dict "root" $ "context" .) | nindent 2 }} {{- end -}} {{- end -}}