From 9be926c4367b9a08cb8a1fa2160e7530f74f1009 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Fri, 25 Jun 2021 14:58:36 -0300 Subject: [PATCH] Fix plonecfg job for readwriteonce volumes --- charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml b/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml index 7c57476..ed12951 100644 --- a/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml +++ b/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml @@ -9,9 +9,8 @@ spec: template: metadata: annotations: - "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "-1" - "helm.sh/resource-policy": "keep" labels: {{- include "portalmodelo.ploneSelectorLabels" . | nindent 8 }} spec: @@ -41,7 +40,11 @@ spec: command: [ "/configure.sh" ] env: - name: ZEO_ADDRESS + {{- if .Values.instance.zeoclient }} + value: {{ template "portalmodelo.fullname" . }}-zeoserver:8100 + {{- else }} value: "" + {{- end }} - name: EMAIL value: {{ .Values.portal.adminEmail }} - name: PASSWORD @@ -56,6 +59,7 @@ spec: value: {{ .Values.portal.rootPassword }} - name: TZ value: {{ .Values.portal.timeZone }} + {{- if eq .Values.persistence.accessMode "ReadWriteMany" }} volumeMounts: - mountPath: /data name: data @@ -65,4 +69,5 @@ spec: persistentVolumeClaim: claimName: data {{- end }} + {{- end }} {{- end }}