{{- if gt (len .Values.single.config.outputs.influxdb.urls) 0 }}
{{- if .Values.single.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "fullname" . }}-s
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
data:
  telegraf.conf: |+
    {{ template "global_tags" .Values.single.config.global_tags }}
    {{ template "agent" .Values.single.config.agent }}
    {{ template "outputs" .Values.single.config.outputs }}
    {{ template "inputs" .Values.single.config.inputs -}}
{{- end -}}
{{- end -}}