---
apiVersion: v1
kind: Secret
metadata:
  name: pachyderm-storage-secret
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
    suite: pachyderm
data:
  {{- if eq .Values.credentials "s3" }}
  minio-id: {{ .Values.s3.accessKey | b64enc | quote }}
  minio-secret: {{ .Values.s3.secretKey | b64enc | quote  }}
  minio-bucket: {{ .Values.s3.bucketName | b64enc | quote }}
  minio-endpoint: {{ .Values.s3.endpoint | b64enc | quote }}
  minio-secure: {{ toString .Values.s3.secure | b64enc | quote }}
  minio-signature: {{ toString .Values.s3.signature | b64enc | quote }}
  {{- else if eq .Values.credentials "google" }}
  google-bucket: {{ .Values.google.bucketName | b64enc | quote }}
  {{- else if eq .Values.credentials "amazon" }}
  amazon-bucket: {{ .Values.amazon.bucketName | b64enc | quote }}
  amazon-distribution: {{ .Values.amazon.distribution | b64enc | quote }}
  amazon-id: {{ .Values.amazon.id | b64enc | quote }}
  amazon-region: {{ .Values.amazon.region | b64enc | quote }}
  amazon-secret: {{ .Values.amazon.secret | b64enc | quote }}
  amazon-token: {{ .Values.amazon.token | b64enc | quote }}
  {{- else if eq .Values.credentials "microsoft" }}
  microsoft-container: {{ .Values.microsoft.container | b64enc | quote }}
  microsoft-id: {{ .Values.microsoft.id | b64enc | quote }}
  microsoft-secret: {{ .Values.microsoft.secret | b64enc | quote }}
  {{- end }}
