diff --git a/charts/janssen/charts/opendj/templates/statefulset.yaml b/charts/janssen/charts/opendj/templates/statefulset.yaml index 580800c7559..4db20686358 100644 --- a/charts/janssen/charts/opendj/templates/statefulset.yaml +++ b/charts/janssen/charts/opendj/templates/statefulset.yaml @@ -31,48 +31,31 @@ spec: securityContext: runAsUser: 1000 runAsNonRoot: true - fsGroup: 1000 - #fsGroupChangePolicy: "OnRootMismatch" enable once 1.23 is the lowest version - {{- if $.Values.global.upgrade.enabled }} initContainers: - command: - - /bin/chown - - -R - - 1000:1000 - - /opt/opendj/logs + - /bin/sh + - -c + - ls -l /opt/opendj; /bin/chown -R 1000:1000 /opt/opendj || echo "did not work"; ls -l /opt/opendj; sleep 5 image: busybox:latest imagePullPolicy: Always - name: change-logs-ownership + name: change-folders-ownership resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - - mountPath: /opt/opendj/logs - name: opendj-volume - subPath: logs - - command: - - /bin/chown - - -R - - 1000:1000 - - /opt/opendj/db - image: busybox:latest - imagePullPolicy: Always - name: change-db-ownership - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - - command: - - /bin/chown - - -R - - 1000:1000 - - /opt/opendj/config - image: busybox:latest - imagePullPolicy: Always - name: change-config-ownership - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - {{- end }} + {{- range $key, $values := $.Values.openDjVolumeMounts }} + - mountPath: {{$values.mountPath}} + name: {{$values.name}} + subPath: {{$key}} + {{- end }} + {{- with $.Values.volumeMounts }} +{{- toYaml . | nindent 10 }} + {{- end }} + {{- if $.Values.global.upgrade.enabled }} + - name: ox-ldif-cm + mountPath: /opt/opendj/config/schema/101-jans.ldif + subPath: 101-jans.ldif + {{- end }} {{- with $.Values.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }}