{{- if .Values.dapr_config_chart_included }}
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: {{ .Values.dapr_default_system_config_name }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- range $key, $value := .Values.global.k8sLabels }}
    {{ $key }}: {{ tpl $value $ }}
    {{- end }}
spec:
  mtls:
    enabled: {{ .Values.global.mtls.enabled }}
    workloadCertTTL: {{ .Values.global.mtls.workloadCertTTL }}
    allowedClockSkew: {{ .Values.global.mtls.allowedClockSkew }}
    controlPlaneTrustDomain: {{ .Values.global.mtls.controlPlaneTrustDomain }}
    sentryAddress: {{ if .Values.global.mtls.sentryAddress }}{{ .Values.global.mtls.sentryAddress }}{{ else }}dapr-sentry.{{ .Release.Namespace }}.svc.cluster.local:443{{ end }}
{{- end }}
