From eda9377f4c6e8ea66fa2f528660882eeffe17fad Mon Sep 17 00:00:00 2001 From: florianMalbranque Date: Wed, 4 Sep 2024 14:21:19 +0200 Subject: [PATCH] Fix mutualise resource definition --- charts/trino/templates/_helpers.tpl | 1 + .../templates/configmap-coordinator.yaml | 29 +++---------------- charts/trino/templates/configmap-worker.yaml | 12 ++------ 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/charts/trino/templates/_helpers.tpl b/charts/trino/templates/_helpers.tpl index e1682c80..74aef96a 100644 --- a/charts/trino/templates/_helpers.tpl +++ b/charts/trino/templates/_helpers.tpl @@ -143,6 +143,7 @@ Create the name of the file auth secret to use {{- define "trino.accessControlConfigMap" -}} {{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index 1f21acd3..44d68a57 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -122,38 +122,17 @@ data: {{- end }} {{ end }} -{{- if .Values.accessControl }} - {{ include "trino.accessControlProperties" . }} -{{- end }} -{{- range $fileName, $fileContent := .Values.worker.additionalConfigFiles }} +{{ include "trino.accessControlProperties" . }} + +{{- range $fileName, $fileContent := .Values.coordinator.additionalConfigFiles }} {{ $fileName }}: | {{- $fileContent | nindent 4 }} {{- end }} ---- -{{- if .Values.accessControl }} - {{- if eq .Values.accessControl.type "configmap" }} - {{ include "trino.accessControlConfigMap" . }} - {{- end }} -{{- end }} +{{ include "trino.accessControlConfigMap" . }} ---- -{{- if .Values.resourceGroups }} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator - namespace: {{ .Release.Namespace }} - labels: - {{- include "trino.labels" . | nindent 4 }} - app.kubernetes.io/component: coordinator -data: - resource-groups.json: |- - {{- .Values.resourceGroups.resourceGroupsConfig | nindent 4 }} -{{- end }} --- diff --git a/charts/trino/templates/configmap-worker.yaml b/charts/trino/templates/configmap-worker.yaml index e5f24daa..0d83fa8d 100644 --- a/charts/trino/templates/configmap-worker.yaml +++ b/charts/trino/templates/configmap-worker.yaml @@ -84,22 +84,16 @@ data: {{ end }} -{{- if .Values.accessControl }} - {{ include "trino.accessControlProperties" . }} -{{- end }} +{{ include "trino.accessControlProperties" . }} + {{- range $fileName, $fileContent := .Values.worker.additionalConfigFiles }} {{ $fileName }}: | {{- $fileContent | nindent 4 }} {{- end }} ---- +{{ include "trino.accessControlConfigMap" . }} -{{- if .Values.accessControl }} - {{- if eq .Values.accessControl.type "configmap" }} - {{ include "trino.accessControlConfigMap" . }} - {{- end }} -{{- end }} --- apiVersion: v1