{{- if eq .Values.schedule "now" -}}
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ template "mysqldump.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "mysqldump.name" . }}
    helm.sh/chart: {{ include "mysqldump.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
  backoffLimit: 1
  template:
{{- $file := .Files.Get "files/job.tpl" }}
{{ tpl $file . | indent 4 }}
{{ end }}
