Skip to content

Commit ff84aa9

Browse files
committed
Back compat for schedules.
A touch less graceful than I'd like but it does work. Signed-off-by: W. Kavanaugh Latiolais <[email protected]>
1 parent 4d2343d commit ff84aa9

File tree

7 files changed

+57
-3
lines changed

7 files changed

+57
-3
lines changed

charts/velero/ci/test-values-back-compat.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ serviceAccount:
1919
server:
2020
name: velero
2121

22+
schedules:
23+
mybackup:
24+
schedule: "0 0 * * *"
25+
template:
26+
ttl: "240h"
27+
includedNamespaces:
28+
- foo
2229
# Whether or not to clean up CustomResourceDefintions when deleting a release.
2330
# Cleaning up CRDs will delete the BackupStorageLocation and VolumeSnapshotLocation instances, which would have to be reconfigured.
2431
# Backup data in object storage will _not_ be deleted, however Backup instances in the Kubernetes API will.

charts/velero/ci/test-values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ serviceAccount:
1818
server:
1919
name: velero
2020

21+
schedules:
22+
- name: mybackup
23+
schedule: "0 0 * * *"
24+
template:
25+
ttl: "240h"
26+
includedNamespaces:
27+
- foo
2128
# Whether or not to clean up CustomResourceDefintions when deleting a release.
2229
# Cleaning up CRDs will delete the BackupStorageLocation and VolumeSnapshotLocation instances, which would have to be reconfigured.
2330
# Backup data in object storage will _not_ be deleted, however Backup instances in the Kubernetes API will.

charts/velero/tests/__snapshot__/back-compat-snapshot_test.yaml.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,22 @@ manifest should match snapshot:
164164
bucket: velero
165165
region: us-west-1
166166
provider: aws
167+
5: |
168+
apiVersion: velero.io/v1
169+
kind: Schedule
170+
metadata:
171+
annotations:
172+
helm.sh/hook: post-install,post-upgrade
173+
helm.sh/hook-delete-policy: before-hook-creation
174+
labels:
175+
app.kubernetes.io/instance: RELEASE-NAME
176+
app.kubernetes.io/managed-by: Tiller
177+
app.kubernetes.io/name: velero
178+
helm.sh/chart: velero-2.14.0
179+
name: RELEASE-NAME-velero-mybackup
180+
spec:
181+
schedule: 0 0 * * *
182+
template:
183+
includedNamespaces:
184+
- foo
185+
ttl: 240h

charts/velero/tests/__snapshot__/snapshot__test.yaml.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,22 @@ manifest should match snapshot:
164164
bucket: velero
165165
region: us-west-1
166166
provider: aws
167+
5: |
168+
apiVersion: velero.io/v1
169+
kind: Schedule
170+
metadata:
171+
annotations:
172+
helm.sh/hook: post-install,post-upgrade
173+
helm.sh/hook-delete-policy: before-hook-creation
174+
labels:
175+
app.kubernetes.io/instance: RELEASE-NAME
176+
app.kubernetes.io/managed-by: Tiller
177+
app.kubernetes.io/name: velero
178+
helm.sh/chart: velero-2.14.0
179+
name: RELEASE-NAME-velero-mybackup
180+
spec:
181+
schedule: 0 0 * * *
182+
template:
183+
includedNamespaces:
184+
- foo
185+
ttl: 240h

charts/velero/tests/back-compat-snapshot_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ templates:
33
- backupstoragelocation.yaml
44
- restic-daemonset.yaml
55
- volumesnapshotlocation.yaml
6+
- schedule.yaml
67
tests:
78
- it: manifest should match snapshot
89
values:

charts/velero/tests/snapshot__test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ templates:
33
- backupstoragelocation.yaml
44
- restic-daemonset.yaml
55
- volumesnapshotlocation.yaml
6+
- schedule.yaml
67
tests:
78
- it: manifest should match snapshot
89
values:

charts/velero/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ restic:
262262
# Backup schedules to create.
263263
# Eg:
264264
# schedules:
265-
# name: mybackup
265+
# - name: mybackup
266266
# schedule: "0 0 * * *"
267267
# template:
268268
# ttl: "240h"
269269
# includedNamespaces:
270270
# - foo
271-
schedules: []
271+
# schedules: []
272272

273273
scheduleLabels: {}
274274

@@ -287,7 +287,7 @@ configMaps: {}
287287
## End of additional Velero resource settings.
288288
##
289289

290-
# Depricated configuration key
290+
# Depricated
291291
configuration:
292292
backupStorageLocation: {}
293293
volumeSnapshotLocation: {}

0 commit comments

Comments
 (0)