Skip to content

Commit

Permalink
Fix volumes when using existing claim
Browse files Browse the repository at this point in the history
When using existingClaim two volumes with the name `data` were
generated.
This commit fix the usage of persistence enabled or not and if an
existing volume is used or not.

Signed-off-by: Guillaume Perrin <guillaume.perrin@linxo.com>
  • Loading branch information
Guillaume Perrin committed Oct 3, 2022
1 parent e7f9269 commit 0737fa1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions templates/statefullset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -273,6 +271,7 @@ spec:
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
{{- else }}
- name: data
Expand Down

0 comments on commit 0737fa1

Please sign in to comment.