{{- if and .Values.cluster.backup.enabled .Values.cluster.enabled -}}
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
  name: {{ include "Atlantis.fullname" . }}-db
spec:
  schedule: "0 0 1 * * *"
  backupOwnerReference: self
  cluster:
    name: '{{ include "Atlantis.fullname" . }}-db'
{{- end }}
