Skip to content

Commit

Permalink
fix: add checks to DR cron templates (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiodionisi authored Oct 29, 2024
1 parent 287ce5e commit 718217b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions templates/distribution/manifests/dr/kustomization.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ patchesStrategicMerge:
{{- if eq .spec.distribution.common.provider.type "eks" }}
- patches/eks-velero.yml
{{- end }}
{{- if and (.spec.distribution.modules.dr.velero.schedules.install) (ne .spec.distribution.modules.dr.velero.schedules.cron.manifests "") }}
{{- if .spec.distribution.modules.dr.velero.schedules.install }}
{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests")) }}
- patches/velero-schedule-manifests.yml
{{- end }}
{{- if and (.spec.distribution.modules.dr.velero.schedules.install) (ne .spec.distribution.modules.dr.velero.schedules.cron.full "") }}
{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full")) }}
- patches/velero-schedule-full.yml
{{- end }}
{{- end }}

{{- if eq .spec.distribution.common.provider.type "none" }}
{{- if eq .spec.distribution.modules.dr.velero.backend "externalEndpoint" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full")) }}
---
apiVersion: velero.io/v1
kind: Schedule
Expand All @@ -12,7 +13,8 @@ spec:
{{- if and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full") }}
schedule: {{ .spec.distribution.modules.dr.velero.schedules.cron.full }}
{{- end }}
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
template:
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
ttl: {{ .spec.distribution.modules.dr.velero.schedules.ttl }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests")) }}
---
apiVersion: velero.io/v1
kind: Schedule
Expand All @@ -12,7 +13,8 @@ spec:
{{- if and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests") }}
schedule: {{ .spec.distribution.modules.dr.velero.schedules.cron.manifests }}
{{- end }}
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
template:
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
ttl: {{ .spec.distribution.modules.dr.velero.schedules.ttl }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 718217b

Please sign in to comment.