{{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}}
{{- $cfgname :=  printf "cfg-%s" $name | trunc 63  }}

apiVersion: v1
kind: ConfigMap
metadata:
  name: "{{ $cfgname }}"
  labels:
    app: {{ template "ordering-backgroundtasks.name" . }}
    chart: {{ template "ordering-backgroundtasks.chart" .}}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};TrustServerCertificate={{ .Values.inf.sql.common.TrustServerCertificate }};
  ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
  all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
  all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
  all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
  graceperiodmanager__CheckUpdateTime: "{{ .Values.cfg.checkUpdateTime }}"
  graceperiodmanager__GracePeriodTime: "{{ .Values.cfg.gracePeriodTime }}"