diff --git a/templates/statefullset.yaml b/templates/statefullset.yaml index a8a9e03..d8f47bd 100644 --- a/templates/statefullset.yaml +++ b/templates/statefullset.yaml @@ -223,13 +223,6 @@ spec: {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} {{- end }} volumes: -{{- if .Values.persistence.enabled }} -{{- if .Values.persistence.existingClaim }} - - name: data - persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim }} -{{- end }} -{{- end }} {{- if .Values.customLdifFiles }} - name: custom-ldif-files configMap: @@ -251,7 +244,12 @@ spec: {{- if .Values.extraVolumes }} {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }} {{- end }} -{{- if (not .Values.persistence.existingClaim) }} +{{- if .Values.persistence.enabled }} +{{- if .Values.persistence.existingClaim }} + - name: data + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} +{{- else }} volumeClaimTemplates: - metadata: name: data @@ -273,6 +271,7 @@ spec: {{- else }} storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} + {{- end }} {{- end }} {{- else }} - name: data