{{- if .Values.mysql.password }}
apiVersion: v1
kind: Secret
metadata:
  name: "{{ template "mysqldump.fullname" . }}"
  labels:
{{ include "mysqldump.labels" . | indent 4 }}
type: Opaque
data:
  MYSQL_PWD: {{ .Values.mysql.password | b64enc | quote }}
{{- if and (.Values.upload.openstack.enabled) (not .Values.upload.openstack.existingSecret) }}
  OS_PASSWORD: {{ .Values.upload.openstack.password | b64enc | quote }}
{{- end }}
---
{{- end }}
{{- if .Values.upload.ssh.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: "{{ template "mysqldump.fullname" . }}-ssh-privatekey"
  labels:
{{ include "mysqldump.labels" . | indent 4 }}
type: Opaque
stringData:
  id_rsa: {{ .Values.upload.ssh.privatekey | quote }}
---
{{- end }}
{{- if .Values.upload.googlestoragebucket.enabled }}
{{- if not .Values.upload.googlestoragebucket.existingSecret }}
{{- if not .Values.upload.googlestoragebucket.usingGCPController }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "mysqldump.gcpsecretName" . }}
  labels:
{{ include "mysqldump.labels" . | indent 4 }}
type: Opaque
stringData:
  {{ .Values.upload.googlestoragebucket.secretFileName }}: {{ .Values.upload.googlestoragebucket.jsonKeyfile | quote }}
{{ end }}
{{ end }}
{{ end }}