mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 18:52:18 -03:00
add lists
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
suite: velero backupStorageLocationList test
|
||||
templates:
|
||||
- common.yaml
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct spec with aws provider and credential
|
||||
set:
|
||||
backupStorageLocationList:
|
||||
- name: my-snap1
|
||||
enabled: true
|
||||
provider: aws
|
||||
credential:
|
||||
aws:
|
||||
id: my-id
|
||||
key: my-key
|
||||
objectStorage:
|
||||
bucket: my-bucket
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: stringData
|
||||
value:
|
||||
cloud: |-
|
||||
[default]
|
||||
aws_access_key_id=my-id
|
||||
aws_secret_access_key=my-key
|
||||
- documentIndex: &backStoreLocDoc 1
|
||||
isKind:
|
||||
of: BackupStorageLocation
|
||||
- documentIndex: *backStoreLocDoc
|
||||
isAPIVersion:
|
||||
of: velero.io/v1
|
||||
- documentIndex: *backStoreLocDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
provider: velero.io/aws
|
||||
credential:
|
||||
name: bsl-test-release-name-common-test-my-snap1
|
||||
key: cloud
|
||||
accessMode: ReadWrite
|
||||
objectStorage:
|
||||
bucket: my-bucket
|
||||
@@ -0,0 +1,46 @@
|
||||
suite: velero volumeSnapshotLocationList spec test
|
||||
templates:
|
||||
- common.yaml
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct spec with aws provider and credential
|
||||
set:
|
||||
volumeSnapshotLocationList:
|
||||
- name: my-snap1
|
||||
enabled: true
|
||||
provider: aws
|
||||
credential:
|
||||
aws:
|
||||
id: my-id
|
||||
key: my-key
|
||||
asserts:
|
||||
- documentIndex: &secretDoc 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *secretDoc
|
||||
isAPIVersion:
|
||||
of: v1
|
||||
- documentIndex: *secretDoc
|
||||
equal:
|
||||
path: stringData
|
||||
value:
|
||||
cloud: |-
|
||||
[default]
|
||||
aws_access_key_id=my-id
|
||||
aws_secret_access_key=my-key
|
||||
- documentIndex: &volSnapLocDoc 1
|
||||
isKind:
|
||||
of: VolumeSnapshotLocation
|
||||
- documentIndex: *volSnapLocDoc
|
||||
isAPIVersion:
|
||||
of: velero.io/v1
|
||||
- documentIndex: *volSnapLocDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
provider: velero.io/aws
|
||||
credential:
|
||||
name: vsl-test-release-name-common-test-my-snap1
|
||||
key: cloud
|
||||
43
library/common-test/tests/lists/volumeSnapshotList_test.yaml
Normal file
43
library/common-test/tests/lists/volumeSnapshotList_test.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
suite: volumeSnapshotList spec test
|
||||
templates:
|
||||
- common.yaml
|
||||
release:
|
||||
name: test-release-name
|
||||
namespace: test-release-namespace
|
||||
tests:
|
||||
- it: should generate correct spec
|
||||
set:
|
||||
volumeSnapshots:
|
||||
- name: example1
|
||||
enabled: true
|
||||
source:
|
||||
volumeSnapshotContentName: some-name
|
||||
- name: example2
|
||||
enabled: true
|
||||
source:
|
||||
persistentVolumeClaimName: some-pvc-name
|
||||
asserts:
|
||||
- documentIndex: &volumeSnapshotDoc 0
|
||||
isKind:
|
||||
of: VolumeSnapshot
|
||||
- documentIndex: *volumeSnapshotDoc
|
||||
isAPIVersion:
|
||||
of: snapshot.storage.k8s.io/v1
|
||||
- documentIndex: *volumeSnapshotDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
source:
|
||||
volumeSnapshotContentName: some-name
|
||||
- documentIndex: &otherVolumeSnapshotDoc 1
|
||||
isKind:
|
||||
of: VolumeSnapshot
|
||||
- documentIndex: *otherVolumeSnapshotDoc
|
||||
isAPIVersion:
|
||||
of: snapshot.storage.k8s.io/v1
|
||||
- documentIndex: *otherVolumeSnapshotDoc
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
source:
|
||||
persistentVolumeClaimName: some-pvc-name
|
||||
@@ -10,4 +10,10 @@
|
||||
|
||||
{{- include "tc.v1.common.values.ingressList" . -}}
|
||||
|
||||
{{- include "tc.v1.common.values.backupStorageLocationList" . -}}
|
||||
|
||||
{{- include "tc.v1.common.values.volumeSnapshotLocationList" . -}}
|
||||
|
||||
{{- include "tc.v1.common.values.volumeSnapshotList" . -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- define "tc.v1.common.values.volumeSnapshotList" -}}
|
||||
{{- define "tc.v1.common.values.volumeSnapshotLocationList" -}}
|
||||
{{- $rootCtx := . -}}
|
||||
|
||||
{{- range $idx, $vslValues := $rootCtx.Values.volumeSnapshotLocationList -}}
|
||||
|
||||
Reference in New Issue
Block a user