apiVersion: v1
kind: Secret
metadata:
  name: {{ include "carbon-intensity-exporter.fullname" . }}
  namespace: {{ .Values.namespace }}
  labels:
    {{- include "carbon-intensity-exporter.labels" . | nindent 4 }}
data:
{{- if eq .Values.providerName "ElectricityMaps" }}
{{- if .Values.electricityMaps.apiToken }}
  apiToken: {{ .Values.electricityMaps.apiToken | b64enc | quote }}
{{- end }}
{{- end }}
{{- if eq .Values.providerName "WattTime" }}
{{- if .Values.wattTime.username }}
  username: {{ .Values.wattTime.username | b64enc | quote }}
{{- end }}
{{- if .Values.wattTime.password }}
  password: {{ .Values.wattTime.password | b64enc | quote }}
{{- end }}
{{- end }}
