# helm_charts_pachd_secret.yaml
---
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: {{ template "fullname" . }}
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 }}
  google-cred: {{ .Values.google.credentials | b64enc | quote }}
  {{- else if eq .Values.credentials "amazon" }}
  amazon-bucket: {{ .Values.amazon.bucketName | b64enc | quote }}
  {{- if .Values.amazon.distribution }}
  amazon-distribution: {{ .Values.amazon.distribution | b64enc | quote }}
  {{- end }}
  {{- if .Values.amazon.id }}
  amazon-id: {{ .Values.amazon.id | b64enc | quote }}
  {{- end }}
  amazon-region: {{ .Values.amazon.region | b64enc | quote }}
  {{- if not .Values.amazon.roleArn }}
  amazon-secret: {{ .Values.amazon.secret | b64enc | quote }}
  amazon-token: {{ .Values.amazon.token | b64enc | quote }}
  {{- end }}
  {{- 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 }}