apiVersion: v1
kind: Secret
metadata:
  name: {{ template "minio.secretName" . }}
  labels: {{ include "common.labels" . | nindent 4 }}
type: Opaque
data:
  accesskey: {{ if .Values.accessKey }}{{ .Values.accessKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 20 | b64enc | quote }}{{ end }}
  secretkey: {{ if .Values.secretKey }}{{ .Values.secretKey | toString | b64enc | quote }}{{ else }}{{ randAlphaNum 40 | b64enc | quote }}{{ end }}
  {{ if eq (include "minio.certAvailable" .) "true" }}
  certPublicKey: {{ (include "minio.cert.publicKey" .) | toString | b64enc | quote }}
  certPrivateKey: {{ (include "minio.cert.privateKey" .) | toString | b64enc | quote }}
  {{ end }}
