apiVersion: v1
kind: Secret
metadata:
  name: {{ template "secretName" . }}
  labels: {{ include "common.labels" . | nindent 4 }}
type: Opaque
data:
  username: {{ .Values.config.username | b64enc | quote }}
  password: {{ .Values.config.password | b64enc | quote }}
  {{ if eq (include "certAvailable" .) "true" }}
  certPublicKey: {{ (include "cert.publicKey" .) | toString | b64enc | quote }}
  certPrivateKey: {{ (include "cert.privateKey" .) | toString | b64enc | quote }}
  {{ else }}
    {{ fail "No certificate configured for Collabora" }}
  {{ end }}
