apiVersion: v1
kind: Secret
metadata:
  name: {{ template "kafka-manager.fullname" . }}
  labels:
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/name: {{ include "kafka-manager.name" . }}
    app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" | trunc 63 }}
    helm.sh/chart: {{ include "kafka-manager.chart" . }}
type: Opaque
data:
  {{ if .Values.applicationSecret }}
  applicationSecret:  {{ .Values.applicationSecret | b64enc | quote }}
  {{ else }}
  applicationSecret: {{ randAlphaNum 10 | b64enc | quote }}
  {{ end }}
  basicAuthUsername:  {{ .Values.basicAuth.username | b64enc | quote }}
  {{ if .Values.basicAuth.password }}
  basicAuthPassword:  {{ .Values.basicAuth.password | b64enc | quote }}
  {{ else }}
  basicAuthPassword: {{ randAlphaNum 10 | b64enc | quote }}
  {{ end }}
