Skip to content

Commit

Permalink
Support groups without password authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
huw0 authored and losipiuk committed Mar 13, 2024
1 parent 6b68924 commit 7864290
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ data:
password-authenticator.properties: |
password-authenticator.name=file
file.password-file={{ .Values.server.config.path }}/auth/password.db
{{- end }}
{{- if .Values.auth.groups }}
group-provider.properties: |
group-provider.name=file
Expand All @@ -111,7 +112,6 @@ data:
file.refresh-period={{ .Values.auth.refreshPeriod }}
{{- end }}
{{- end }}
{{- end }}

{{ if .Values.eventListenerProperties }}
event-listener.properties: |
Expand Down
12 changes: 7 additions & 5 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ spec:
configMap:
name: trino-resource-groups-volume-coordinator
{{- end }}
{{- if contains "PASSWORD" .Values.server.config.authenticationType }}
- name: password-volume
{{- if or .Values.auth.passwordAuth .Values.auth.groups }}
- name: file-authentication-volume
secret:
{{- if and .Values.auth .Values.auth.passwordAuthSecret }}
secretName: {{ .Values.auth.passwordAuthSecret }}
{{- else }}
secretName: trino-password-authentication
secretName: trino-file-authentication
{{- end }}
items:
{{- if .Values.auth.passwordAuth }}
- key: password.db
path: password.db
{{- end }}
{{- if .Values.auth.groups }}
- key: group.db
path: group.db
Expand Down Expand Up @@ -129,9 +131,9 @@ spec:
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
{{- if contains "PASSWORD" .Values.server.config.authenticationType }}
{{- if or .Values.auth.passwordAuth .Values.auth.groups }}
- mountPath: {{ .Values.server.config.path }}/auth
name: password-volume
name: file-authentication-volume
{{- end }}
{{- with .Values.coordinator.additionalVolumeMounts }}
{{- . | toYaml | nindent 12 }}
Expand Down
10 changes: 5 additions & 5 deletions charts/trino/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{{- if contains "PASSWORD" .Values.server.config.authenticationType }}
{{- if .Values.auth.passwordAuth -}}
{{- if or .Values.auth.passwordAuth .Values.auth.groups }}
apiVersion: v1
kind: Secret
metadata:
{{- if and .Values.auth .Values.auth.passwordAuthSecret }}
name: {{ .Values.auth.passwordAuthSecret }}
{{- else }}
name: trino-password-authentication
name: trino-file-authentication
{{- end }}
labels:
{{- include "trino.labels" . | nindent 4 }}
data:
{{- if .Values.auth.passwordAuth }}
password.db: {{ .Values.auth.passwordAuth | b64enc }}
{{- if .Values.auth.groups}}
{{- end }}
{{- if .Values.auth.groups}}
group.db: {{ .Values.auth.groups | b64enc }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 7864290

Please sign in to comment.