From 820d5471dc4abf625895256a3a6e503171a43a3c Mon Sep 17 00:00:00 2001 From: florianMalbranque Date: Tue, 30 Jan 2024 16:37:30 +0100 Subject: [PATCH] Allow password authentication to be used with other authentication types When a Trino cluster is configured to work with multiple authentication types through server.config.authenticationType key (e.g PASSWORD,OAUTH2), the password-authenticator.properties key is not configured in coordinator configmap because its template expects that authenticationType must equals to 'PASSWORD'. This prevents password authentication type to work and cluster coordinator to start. --- charts/trino/templates/configmap-coordinator.yaml | 2 +- charts/trino/templates/deployment-coordinator.yaml | 4 ++-- charts/trino/templates/secret.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index 4fb3c2cb..f85ee2ed 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -99,7 +99,7 @@ data: {{ $configValue }} {{- end }} - {{- if eq .Values.server.config.authenticationType "PASSWORD" }} + {{- if contains "PASSWORD" .Values.server.config.authenticationType }} password-authenticator.properties: | password-authenticator.name=file file.password-file={{ .Values.server.config.path }}/auth/password.db diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 3020b96e..8bb70d60 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -63,7 +63,7 @@ spec: configMap: name: trino-resource-groups-volume-coordinator {{- end }} - {{- if eq .Values.server.config.authenticationType "PASSWORD" }} + {{- if contains "PASSWORD" .Values.server.config.authenticationType }} - name: password-volume secret: {{- if and .Values.auth .Values.auth.passwordAuthSecret }} @@ -126,7 +126,7 @@ spec: - name: {{ .name }} mountPath: {{ .path }} {{- end }} - {{- if eq .Values.server.config.authenticationType "PASSWORD" }} + {{- if contains "PASSWORD" .Values.server.config.authenticationType }} - mountPath: {{ .Values.server.config.path }}/auth name: password-volume {{- end }} diff --git a/charts/trino/templates/secret.yaml b/charts/trino/templates/secret.yaml index 6f2dc70f..ad52d39e 100644 --- a/charts/trino/templates/secret.yaml +++ b/charts/trino/templates/secret.yaml @@ -1,4 +1,4 @@ -{{- if eq .Values.server.config.authenticationType "PASSWORD" }} +{{- if contains "PASSWORD" .Values.server.config.authenticationType }} {{- if .Values.auth.passwordAuth -}} apiVersion: v1 kind: Secret