{{- if .Values.snapshotsEnabled }}
apiVersion: velero.io/v1
kind: VolumeSnapshotLocation
metadata:
  name: {{ include "velero.volumeSnapshotLocation.name" . }}
  namespace: {{ .Release.Namespace }}
  annotations:
    "helm.sh/hook": post-install,post-upgrade,post-rollback
    "helm.sh/hook-delete-policy": before-hook-creation
  labels:
    app.kubernetes.io/name: {{ include "velero.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    helm.sh/chart: {{ include "velero.chart" . }}
spec:
  provider: {{ include "velero.volumeSnapshotLocation.provider" . }}
{{- with .Values.configuration.volumeSnapshotLocation.config }}
  config:
{{- range $key, $value := . }}
{{- $key | nindent 4 }}: {{ $value | quote }}
{{- end }}
{{- end -}}
{{- end }}
