# helm_charts_cluster-agent-config-configmap.yaml
{{- if .Values.clusterAgent.datadog_cluster_yaml }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "datadog.fullname" . }}-cluster-agent-config
  labels:
    app: "{{ template "datadog.fullname" . }}"
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    app.kubernetes.io/name: "{{ template "datadog.fullname" . }}"
    app.kubernetes.io/instance: {{ .Release.Name | quote }}
    app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
    app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
  annotations:
    checksum/clusteragent-config: {{ tpl (toYaml .Values.clusterAgent.datadog_cluster_yaml) . | sha256sum }}
data:
  datadog-cluster.yaml: |
{{ tpl (toYaml .Values.clusterAgent.datadog_cluster_yaml) . | indent 4 }}
{{- end }}