apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "shuffle.backend.name" . }}-env
  namespace: {{ include "common.names.namespace" . | quote }}
  labels: {{- include "shuffle.backend.labels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
data:
  BACKEND_PORT: "5001"
  {{- if .Values.shuffle.baseUrl }}
  BASE_URL: "{{ .Values.shuffle.baseUrl }}"
  SSO_REDIRECT_URL: "{{ .Values.shuffle.baseUrl }}"
  {{- else }}
  BASE_URL: "http://{{ include "shuffle.backend.name" . }}:5001"
  {{- end }}
  ORG_ID: "{{ .Values.shuffle.org }}"
  SHUFFLE_APP_DOWNLOAD_LOCATION: "{{ .Values.backend.apps.downloadLocation }}"
  SHUFFLE_DOWNLOAD_AUTH_BRANCH: "{{ .Values.backend.apps.downloadBranch }}"
  SHUFFLE_APP_FORCE_UPDATE: "{{ .Values.backend.apps.forceUpdate }}"
  SHUFFLE_CHAT_DISABLED: "true"
  SHUFFLE_OPENSEARCH_URL: {{ include "common.tplvalues.render" (dict "value" .Values.backend.openSearch.url "context" $) }}
  SHUFFLE_OPENSEARCH_USERNAME: "{{ .Values.backend.openSearch.username }}"
  SHUFFLE_OPENSEARCH_CERTIFICATE_FILE: "{{ .Values.backend.openSearch.certificateFile }}"
  SHUFFLE_OPENSEARCH_SKIPSSL_VERIFY: "{{ .Values.backend.openSearch.skipSSLVerify }}"
  SHUFFLE_OPENSEARCH_INDEX_PREFIX: "{{ .Values.backend.openSearch.indexPrefix }}"
  SHUFFLE_RERUN_SCHEDULE: "{{ .Values.backend.cleanupSchedule }}"
  TZ: "{{ .Values.shuffle.timezone }}"
  REGISTRY_URL: "{{ .Values.shuffle.appRegistry }}"
