From fcad1bcf868eef605213ae93d014bdd025998f07 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 1 May 2025 09:07:39 -0400 Subject: [PATCH] Matrix Authentication Service: migrate DB on init --- .../deployment.yaml | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/charts/matrix-stack/templates/matrix-authentication-service/deployment.yaml b/charts/matrix-stack/templates/matrix-authentication-service/deployment.yaml index d54d3c73..e7071c07 100644 --- a/charts/matrix-stack/templates/matrix-authentication-service/deployment.yaml +++ b/charts/matrix-stack/templates/matrix-authentication-service/deployment.yaml @@ -135,9 +135,35 @@ spec: resources: {{- toYaml . | nindent 10 }} {{- end }} + - name: database-migrate + args: ["database", "migrate"] +{{- with .image -}} +{{- if .digest }} + image: "{{ .registry }}/{{ .repository }}@{{ .digest }}" + imagePullPolicy: {{ .pullPolicy | default "IfNotPresent" }} +{{- else }} + image: "{{ .registry }}/{{ .repository }}:{{ required "matrixAuthenticationService.image.tag is required if no digest" .tag }}" + imagePullPolicy: {{ .pullPolicy | default "Always" }} +{{- end }} +{{- end }} +{{- with .containersSecurityContext }} + securityContext: + {{- toYaml . | nindent 10 }} +{{- end }} + env: + {{- include "element-io.matrix-authentication-service.env" (dict "root" $ "context" .) | nindent 10 }} +{{- with .resources }} + resources: + {{- toYaml . | nindent 10 }} +{{- end }} + volumeMounts: + - mountPath: "/config.yaml" + name: rendered-config + subPath: config.yaml + readOnly: true containers: - name: matrix-authentication-service - args: ["server"] + args: ["server", "--no-migrate"] {{- with .image -}} {{- if .digest }} image: "{{ .registry }}/{{ .repository }}@{{ .digest }}"