apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "sematext.fullname" . }}
  labels:
    app: {{ template "sematext.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
data:
{{- if .Values.sematext.config }}
{{ toYaml .Values.sematext.config | indent 2 }}
{{- end }}
{{- if .Values.sematext.url }}
  SPM_RECEIVER_URL: {{ default "" .Values.sematext.url.spmReceiver | quote }}
  LOGSENE_RECEIVER_URL: {{ default "" .Values.sematext.url.logseneReceiver | quote }}
  EVENTS_RECEIVER_URL: {{ default "" .Values.sematext.url.eventsReceiver | quote }}
{{- else if eq .Values.sematext.region "EU" }}
  SPM_RECEIVER_URL: "https://spm-receiver.eu.sematext.com/receiver/v1"
  LOGSENE_RECEIVER_URL: "https://logsene-receiver.eu.sematext.com"
  EVENTS_RECEIVER_URL: "https://event-receiver.eu.sematext.com"
{{- else if eq .Values.sematext.region "US" }}
  SPM_RECEIVER_URL: "https://spm-receiver.sematext.com/receiver/v1"
  LOGSENE_RECEIVER_URL: "https://logsene-receiver.sematext.com"
  EVENTS_RECEIVER_URL: "https://event-receiver.sematext.com"
{{- end }}
