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

{{/* Append the hardcoded settings */}}
{{- define "magic-mirror.harcodedValues" -}}
persistence:
  magic-mirror-config:
    enabled: "true"
    mountPath: "/opt/magic_mirror/config/config.js"
    subPath: "config.js"
    type: "custom"
    volumeSpec:
      configMap:
        name: {{ printf "%v-config" (include "common.names.fullname" .) }}

  magic-mirror-css:
    enabled: "true"
    mountPath: "/opt/magic_mirror/css/custom.css"
    subPath: "custom.css"
    type: "custom"
    volumeSpec:
      configMap:
        name: {{ printf "%v-css" (include "common.names.fullname" .) }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "magic-mirror.harcodedValues" . | fromYaml) -}}

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