{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}

{{/* Append the hardcoded volumes */}}
{{- define "vikunja.hardcodedValues" -}}
persistence:
  caddy-config:
    enabled: "true"
    mountPath: /etc/caddy/Caddyfile
    subPath: Caddyfile
    type: "custom"
    volumeSpec:
      configMap:
        name: {{ printf "%v-config" (include "common.names.fullname" .) }}
  vikunja-config:
    enabled: "true"
    mountPath: /etc/vikunja/config.yml
    subPath: Vikunja.yaml
    type: "custom"
    volumeSpec:
      configMap:
        name: {{ printf "%v-config" (include "common.names.fullname" .) }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "vikunja.hardcodedValues" . | fromYaml) -}}

{{/* Render the templates */}}
{{ include "common.all" . }}
