Skip to content

Commit

Permalink
Fix mutualise resource definition
Browse files Browse the repository at this point in the history
  • Loading branch information
florianMalbranque committed Sep 4, 2024
1 parent 51d4221 commit 3d38e4f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 55 deletions.
16 changes: 0 additions & 16 deletions charts/trino/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,6 @@ Create the name of the file auth secret to use
{{- end }}


{{- define "trino.accessControlConfigMap" -}}
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "trino.fullname" . }}-access-control-volume
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.accessControl.rules }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}{{- end }}
{{- end }}


{{- define "trino.accessControlProperties" -}}
{{- if .Values.accessControl }}
Expand Down
15 changes: 15 additions & 0 deletions charts/trino/templates/configmap-access-control.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- define "trino.accessControlConfigMap" -}}
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "trino.fullname" . }}-access-control-volume
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.accessControl.rules }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}{{- end }}
{{- end }}
31 changes: 3 additions & 28 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,41 +122,16 @@ 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 }}

---
{{- 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 }}

---

apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
13 changes: 2 additions & 11 deletions charts/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,14 @@ data:
{{ end }}


{{- if .Values.accessControl }}
{{ include "trino.accessControlProperties" . }}
{{- end }}
{{ include "trino.accessControlProperties" . }}


{{- range $fileName, $fileContent := .Values.worker.additionalConfigFiles }}
{{ $fileName }}: |
{{- $fileContent | nindent 4 }}
{{- end }}

---

{{- if .Values.accessControl }}
{{- if eq .Values.accessControl.type "configmap" }}
{{ include "trino.accessControlConfigMap" . }}
{{- end }}
{{- end }}

---
apiVersion: v1
kind: ConfigMap
Expand Down

0 comments on commit 3d38e4f

Please sign in to comment.