{{- if .Values.agents }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "mongoclaw.fullname" . }}-agents
  labels:
    {{- include "mongoclaw.labels" . | nindent 4 }}
data:
  {{- range $name, $config := .Values.agents }}
  {{ $name }}.yaml: |
    id: {{ $name }}
    {{- toYaml $config | nindent 4 }}
  {{- end }}
{{- end }}
