{{- if and .Values.hubble.metrics.dynamic.enabled .Values.hubble.metrics.dynamic.config.createConfigMap }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.hubble.metrics.dynamic.config.configMapName }}
  namespace: {{ include "cilium.namespace" . }}
  {{- with .Values.commonLabels }}
  labels:
    {{- toYaml . | nindent 4 }}
  {{- end }}
data:
  dynamic-metrics.yaml: |
    {{- with .Values.hubble.metrics.dynamic.config.content }}
    metrics:
      {{- toYaml . | nindent 6 }}
    {{- end }}
{{- end }}
