Skip to content

Commit fae8e5c

Browse files
committed
WIP: Adding backcompat testing
Signed-off-by: W. Kavanaugh Latiolais <[email protected]>
1 parent 12dd785 commit fae8e5c

File tree

7 files changed

+25
-22
lines changed

7 files changed

+25
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To run unit tests in this repository please install helm-unittest
2626

2727
```sh
2828
helm plugin install https://github.com/quintush/helm-unittest
29-
helm unittest -3 charts/velero
29+
helm unittest charts/velero
3030
```
3131

3232
## License

charts/velero/templates/_helpers.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,28 +79,28 @@ Create the Restic priority class name.
7979
Create the backup storage location name
8080
*/}}
8181
{{- define "velero.backupStorageLocation.name" -}}
82-
{{ coalesce .Values.backupStorageLocation.name .Values.configuration.backupStorageLocation.name "default" }}
82+
{{ coalesce .Values.configuration.backupStorageLocation.name .Values.backupStorageLocation.name "default" }}
8383
{{- end -}}
8484

8585
{{/*
8686
Create the backup storage location provider
8787
*/}}
8888
{{- define "velero.backupStorageLocation.provider" -}}
89-
{{ coalesce .Values.backupStorageLocation.provider .Values.configuration.backupStorageLocation.provider .Values.provider }}
89+
{{ coalesce .Values.configuration.backupStorageLocation.provider .Values.backupStorageLocation.provider .Values.configuration.provider .Values.provider }}
9090
{{- end -}}
9191

9292
{{/*
9393
Create the volume snapshot location name
9494
*/}}
9595
{{- define "velero.volumeSnapshotLocation.name" -}}
96-
{{ coalesce .Values.volumeSnapshotLocation.name .Values.configuration.volumeSnapshotLocation.name "default" }}
96+
{{ coalesce .Values.configuration.volumeSnapshotLocation.name .Values.volumeSnapshotLocation.name "default" }}
9797
{{- end -}}
9898

9999
{{/*
100100
Create the volume snapshot location provider
101101
*/}}
102102
{{- define "velero.volumeSnapshotLocation.provider" -}}
103-
{{ coalesce .Values.volumeSnapshotLocation.provider .Values.configuration.volumeSnapshotLocation.provider .Values.provider}}
103+
{{ coalesce .Values.configuration.volumeSnapshotLocation.provider .Values.volumeSnapshotLocation.provider .Values.configuration.provider .Values.provider}}
104104
{{- end -}}
105105

106106
{{- define "velero.image-from-values" -}}

charts/velero/templates/backupstoragelocation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
helm.sh/chart: {{ include "velero.chart" . }}
1414
spec:
1515
provider: {{ include "velero.backupStorageLocation.provider" . }}
16-
{{- with coalesce .Values.backupStorageLocation .Values.configuration.backupStorageLocation }}
16+
{{- with coalesce .Values.configuration.backupStorageLocation .Values.backupStorageLocation }}
1717
objectStorage:
1818
bucket: {{ .bucket }}
1919
{{- with .prefix }}

charts/velero/templates/deployment.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ spec:
5757
args:
5858
- server
5959
{{- with .Values }}
60-
{{- with coalesce .backupSyncPeriod .configuration.backupSyncPeriod }}
60+
{{- with coalesce .configuration.backupSyncPeriod .backupSyncPeriod }}
6161
- --backup-sync-period={{ . }}
6262
{{- end }}
63-
{{- with coalesce .resticTimeout .configuration.resticTimeout }}
63+
{{- with coalesce .configuration.resticTimeout .resticTimeout}}
6464
- --restic-timeout={{ . }}
6565
{{- end }}
66-
{{- if coalesce .restoreOnlyMode .configuration.restoreOnlyMode }}
66+
{{- if coalesce .configuration.restoreOnlyMode .restoreOnlyMode}}
6767
- --restore-only
6868
{{- end }}
69-
{{- with coalesce .restoreResourcePriorities .configuration.restoreResourcePriorities }}
69+
{{- with coalesce .configuration.restoreResourcePriorities .restoreResourcePriorities }}
7070
- --restore-resource-priorities={{ . }}
7171
{{- end }}
72-
{{- with coalesce .features .configuration.features }}
72+
{{- with coalesce .configuration.features .features }}
7373
- --features={{ . }}
7474
{{- end }}
75-
{{- with coalesce .configuration.logLevel }}
75+
{{- with coalesce .configuration.logLevel .logLevel }}
7676
- --log-level={{ . }}
7777
{{- end }}
78-
{{- with coalesce .configuration.logFormat }}
78+
{{- with coalesce .configuration.logFormat .logFormat }}
7979
- --log-format={{ . }}
8080
{{- end }}
8181
{{- end }}
@@ -120,7 +120,7 @@ spec:
120120
value: /credentials/cloud
121121
{{- end }}
122122
{{- end }}
123-
{{- with coalesce .Values.extraEnvVars .Values.configuration.extraEnvVars }}
123+
{{- with coalesce .Values.configuration.extraEnvVars .Values.extraEnvVars }}
124124
{{- range $key, $value := . }}
125125
- name: {{ default "none" $key | quote }}
126126
value: {{ default "none" $value | quote }}

charts/velero/templates/restic-daemonset.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ spec:
6464
- restic
6565
- server
6666
{{- with .Values }}
67-
{{- with coalesce .features .configuration.features }}
67+
{{- with coalesce .configuration.features .features }}
6868
- --features={{ . }}
6969
{{- end }}
70-
{{- with coalesce .logLevel .configuration.logLevel }}
70+
{{- with coalesce .configuration.logLevel .logLevel }}
7171
- --log-level={{ . }}
7272
{{- end }}
73-
{{- with coalesce .logFormat .configuration.logFormat }}
73+
{{- with coalesce .configuration.logFormat .logFormat }}
7474
- --log-format={{ . }}
7575
{{- end }}
7676
{{- end }}
@@ -88,7 +88,7 @@ spec:
8888
{{- toYaml .Values.restic.extraVolumeMounts | nindent 12 }}
8989
{{- end }}
9090
env:
91-
{{- with coalesce .Values.extraEnvVars .Values.configuration.extraEnvVars }}
91+
{{- with coalesce .Values.configuration.extraEnvVars .Values.extraEnvVars }}
9292
{{- range $key, $value := . }}
9393
- name: {{ default "none" $key | quote }}
9494
value: {{ default "none" $value | quote }}
@@ -119,7 +119,7 @@ spec:
119119
value: /credentials/cloud
120120
{{- end }}
121121
{{- end }}
122-
{{- with coalesce .Values.extraEnvVars .Values.configuration.extraEnvVars }}
122+
{{- with coalesce .Values.configuration.extraEnvVars .Values.extraEnvVars }}
123123
{{- range $key, $value := . }}
124124
- name: {{ default "none" $key | quote }}
125125
value: {{ default "none" $value | quote }}

charts/velero/templates/volumesnapshotlocation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ metadata:
1313
helm.sh/chart: {{ include "velero.chart" . }}
1414
spec:
1515
provider: {{ include "velero.volumeSnapshotLocation.provider" . }}
16-
{{- with coalesce .Values.volumeSnapshotLocation.config .Values.configuration.volumeSnapshotLocation.config }}
16+
{{- with coalesce .Values.configuration.volumeSnapshotLocation.config .Values.volumeSnapshotLocation.config }}
1717
config:
1818
{{ toYaml . | indent 4 }}
1919
{{- end -}}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ manifest should match snapshot:
8080
helm.sh/chart: velero-2.14.0
8181
name: default
8282
spec:
83+
config:
84+
profile: test
85+
region: us-west-1
8386
objectStorage:
84-
bucket: null
85-
provider: null
87+
bucket: velero
88+
provider: aws
8689
3: |
8790
apiVersion: apps/v1
8891
kind: DaemonSet

0 commit comments

Comments
 (0)