{{- if and (eq .Values.architecture "high-availability") (or (.Files.Glob "files/conf/relay.toml") .Values.relay.configuration) (not .Values.relay.existingConfiguration) }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "influxdb.fullname" . }}-relay
  labels: 
    {{- include "influxdb.labels" . | nindent 4 }}
    app.kubernetes.io/component: relay
data:
{{- if (.Files.Glob "files/conf/relay.toml") }}
{{ (.Files.Glob "iles/conf/relay.toml").AsConfig | indent 2 }}
{{- else if .Values.relay.configuration }}
  relay.toml: |-
{{ tpl .Values.relay.configuration . | indent 4 }}
{{- end }}
{{- end }}
