diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index 61d2092..095795f 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -47,6 +47,7 @@ spec: - | chown {{ .Values.volumePermissions.uid }}:{{ .Values.volumePermissions.gid }} -R /synapse/data image: "{{ .Values.volumePermissions.image.repository }}:{{ .Values.volumePermissions.image.tag }}" + imagePullPolicy: {{ $.Values.volumePermissions.image.pullPolicy }} resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} securityContext: diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index dfbf0b9..e36b034 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -39,10 +39,15 @@ spec: {{- if and $needsVolumePermissions (eq $name "media-repository") }} initContainers: - name: volume-permissions - command: ["chown", "-R", "666:666", "/synapse/data"] - image: "{{ $.Values.volumePermissions.repository }}:{{ $.Values.volumePermissions.tag }}" - imagePullPolicy: {{ $.Values.volumePermissions.pullPolicy }} + command: + - sh + - -c + - | + chown {{ $.Values.volumePermissions.uid }}:{{ $.Values.volumePermissions.gid }} -R /synapse/data + image: "{{ $.Values.volumePermissions.image.repository }}:{{ $.Values.volumePermissions.image.tag }}" + imagePullPolicy: {{ $.Values.volumePermissions.image.pullPolicy }} securityContext: + runAsNonRoot: false runAsUser: 0 resources: {{ $.Values.volumePermissions.resources | toYaml | nindent 12 }} volumeMounts: