Skip to content

Commit

Permalink
[gotsocial] Set the CLaimName in _helpers.tpl to simplify reading of …
Browse files Browse the repository at this point in the history
…deployment.yaml
  • Loading branch information
0hlov3 committed Dec 23, 2024
1 parent 706b7aa commit 0f32837
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 11 additions & 0 deletions charts/gotosocial/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,15 @@ Set postgres host
{{- if .Values.postgresql.enabled -}}
{{- template "gotosocial.postgresql.fullname" . -}}
{{- end -}}
{{- end -}}

{{/*
Create Volumeclaim Name
*/}}
{{- define "gotosocial.volume.claimName" -}}
{{- if and .Values.gotosocial.persistence.enabled (ne .Values.gotosocial.persistence.existingClaim "") -}}
{{ .Values.gotosocial.persistence.existingClaim }}
{{- else -}}
{{ printf "%s-%s" (include "gotosocial.fullname" .) "data" }}
{{- end -}}
{{- end -}}
6 changes: 1 addition & 5 deletions charts/gotosocial/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,7 @@ spec:
{{- if .Values.gotosocial.persistence.enabled }}
- name: gotosocial-data
persistentVolumeClaim:
{{- if .Values.gotosocial.persistence.existingClaim }}
claimName: {{ .Values.gotosocial.persistence.existingClaim }}
{{- else }}
claimName: {{ $fullName }}-data
{{- end }}
claimName: {{ include "gotosocial.volume.claimName" . }}
{{- end }}
{{- if .Values.gotosocial.tmpfs.enabled }}
- name: tmpfs
Expand Down

0 comments on commit 0f32837

Please sign in to comment.