apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "quickwit.fullname" . }}
  labels:
    {{- include "quickwit.labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": pre-install, pre-upgrade
    "helm.sh/hook-weight": "-4" # Higher precidence, so the first the config map will get created.
data:
{{/* https://helm.sh/docs/chart_template_guide/accessing_files/ */}}
{{ $currentScope := .}}
{{- range $path, $_ :=  .Files.Glob (printf "files/**.yaml") }}
    {{- with $currentScope}}
    {{- base $path | nindent 2}}: |-
        {{- tpl (.Files.Get $path) . | nindent 4 }}
    {{- end }}
{{- end }}
