apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "couchdb.fullname" . }}
  labels:
    app: {{ template "couchdb.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
data:
  inifile: |
    {{ range $section, $settings := .Values.couchdbConfig -}}
    {{ printf "[%s]" $section }}
    {{ range $key, $value := $settings -}}
    {{ printf "%s = %s" $key ($value | toString) }}
    {{ end }}
    {{ end }}
