apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "collabora-online.fullname" . }}
  annotations:
    confighash: config-{{ .Values.collabora | toYaml | sha256sum | trunc 32 }}
  labels:
    {{- include "collabora-online.labels" . | nindent 4 }}
data:
  {{- if .Values.collabora.extra_params }}
  extra_params: {{ .Values.collabora.extra_params }}
  {{- end }}
  {{- if .Values.collabora.server_name }}
  server_name: {{ .Values.collabora.server_name }}
  {{- end }}
  {{- range $k,$v := .Values.collabora.aliasgroups }}
  {{- $alias := $v.host }}
  {{- if $v.aliases }}
  {{- $alias := printf "%s,%s" $alias (join "," $v.aliases) }}
  aliasgroup{{ add $k 1 }}: {{ $alias }}
  {{- else }}
  aliasgroup{{ add $k 1 }}: {{ $alias }}
  {{- end }}
  {{- end }}
