{{ if and (or (.Files.Glob "files/my.cnf") .Values.mariadbConfiguration) (not .Values.configurationConfigMap) }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "mariadb-galera.fullname" . }}-configuration
  labels: {{- include "mariadb-galera.labels" . | nindent 4 }}
data:
{{- if (.Files.Glob "files/my.cnf") }}
{{ (.Files.Glob "files/my.cnf").AsConfig | indent 2 }}
{{- else if .Values.mariadbConfiguration }}
  my.cnf: |
{{ .Values.mariadbConfiguration | indent 4 }}
{{- end }}
{{ end }}
