{{- if .Values.configurator.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "home-assistant.fullname" . }}-configurator
  labels:
    app: {{ template "home-assistant.name" . }}
    chart: {{ template "home-assistant.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
  {{- if .Values.configurator.hassApiPassword }}
  hass-api-password: {{ .Values.configurator.hassApiPassword | b64enc | quote }}
  {{- end }}
  {{- if .Values.configurator.username }}
  username: {{ .Values.configurator.username | b64enc | quote }}
  {{- end }}
  {{- if .Values.configurator.password }}
  password: {{ .Values.configurator.password | b64enc | quote }}
  {{- end }}
{{- end }}