{{- if and (.Values.ingress.enabled) (.Values.ingress.basicAuth.enabled) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ .Values.ingress.basicAuth.name | default "basic-auth" }}
  labels:
    app.kubernetes.io/name: {{ include "cassandra-reaper.name" . }}
    helm.sh/chart: {{ include "cassandra-reaper.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
  auth: {{ required ".Values.ingress.basicAuth.secret is required when basicAuth is enabled" .Values.ingress.basicAuth.secret }}
{{- end }}
