Skip to content
Snippets Groups Projects
Verified Commit 8e0b337b authored by Philipp S. Sommer's avatar Philipp S. Sommer
Browse files

improve handling of cronjob volumes

parent 95323ad5
No related branches found
No related tags found
1 merge request!49improve cronjob volumes and reuse
......@@ -31,6 +31,20 @@ jobTemplate:
metadata:
labels:
parent: {%raw %}{{ .name | quote }}{% endraw %}
annotations:
{%- if cookiecutter.__include_volume != 'no' %}
{%- raw %}
{{- $excludedVolumes := dict "volumes" list }}
{{- range $name, $options := .volumes }}
{{- if or $options.projected $options.excludeFromBackup }}
{{- $_ := set $excludedVolumes "volumes" (append $excludedVolumes.volumes $name) }}
{{- end }}
{{- end }}
{{- if $excludedVolumes.volumes }}
backup.velero.io/backup-volumes-excludes: {{ join "," $excludedVolumes.volumes | quote }}
{{- end }}
{%- endraw %}
{%- endif %}
spec:
{%- if cookiecutter.__include_volume != 'no' %}
affinity:
......@@ -68,8 +82,12 @@ jobTemplate:
{%- raw %}
{{- range $name, $options := .volumes }}
- name: {{ $name | quote }}
{{- if $options.projected }}
projected: {{ toYaml $options.projected | nindent 8 }}
{{- else }}
persistentVolumeClaim:
claimName: {{ $name | quote }}
{{- end }}
{{- end }}
{%- endraw %}
{%- endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment