# grafana_charts_logs-instance-usernames-secret.yaml
{{- if ((.Values.metaMonitoring).grafanaAgent).enabled }}
{{- with .Values.metaMonitoring.grafanaAgent.logs }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "logs-instance-usernames") }}
  namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default $.Release.Namespace | quote }}
  labels:
    {{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
data:
  {{- range $i, $cfg := prepend (.additionalClientConfigs | default list) .remote }}
  {{- if (($cfg).auth).username }}
  username-{{ $i }}: {{ (($cfg).auth).username | b64enc | quote }}
  {{- end }}
  {{- end }}
{{- end }}
{{- end }}