mirror of
https://github.com/truenas/charts.git
synced 2026-05-16 14:12:59 +08:00
NAS-123350 / 24.04 / Add support in common for nfs/smb pvc (#1422)
* Empty-Commit * temp commit * make sure that we use the pv * typo * add validation * typo * cleanup validation and add secret for smb * revert * add some tets * add more tests * add more tests * more tests * rename to share * rename * moar tests * clean * add some docs * fix name uniqueness and tests * make mountOptions validation a bit better * update docs
This commit is contained in:
30
library/common-test/tests/pod/volume_ix-zfs-pvc_test.yaml
Normal file
30
library/common-test/tests/pod/volume_ix-zfs-pvc_test.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
suite: pod ix-zfs-pvc volume test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with pvc volume
|
||||
set:
|
||||
global:
|
||||
ixChartContext:
|
||||
storageClassName: ix-storage-class-releasename
|
||||
workload:
|
||||
workload-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec: {}
|
||||
persistence:
|
||||
pvc-vol:
|
||||
enabled: true
|
||||
type: ix-zfs-pvc
|
||||
asserts:
|
||||
- documentIndex: &deploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: pvc-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-pvc-vol
|
||||
55
library/common-test/tests/pod/volume_nfs-pv-pvc_test.yaml
Normal file
55
library/common-test/tests/pod/volume_nfs-pv-pvc_test.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
suite: pod nfs-pv-pvc volume test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with nfs-pv-pvc volume
|
||||
set:
|
||||
workload:
|
||||
workload-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec: {}
|
||||
persistence:
|
||||
my-volume1:
|
||||
enabled: true
|
||||
type: nfs-pv-pvc
|
||||
server: my-server
|
||||
share: /my-path
|
||||
my-volume2:
|
||||
enabled: true
|
||||
type: nfs-pv-pvc
|
||||
server: my-server2
|
||||
share: /my-path2
|
||||
asserts:
|
||||
- documentIndex: &pvDoc 0
|
||||
isKind:
|
||||
of: PersistentVolume
|
||||
- documentIndex: *pvDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: release-name-common-test-my-volume1-1088882375
|
||||
- documentIndex: &otherPvDoc 2
|
||||
isKind:
|
||||
of: PersistentVolume
|
||||
- documentIndex: *otherPvDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: release-name-common-test-my-volume2-1303447339
|
||||
- documentIndex: &deploymentDoc 4
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: my-volume1
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-my-volume1-1088882375
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: my-volume2
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-my-volume2-1303447339
|
||||
52
library/common-test/tests/pod/volume_pvc_test.yaml
Normal file
52
library/common-test/tests/pod/volume_pvc_test.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
suite: pod pvc volume test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with pvc volume
|
||||
set:
|
||||
workload:
|
||||
workload-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec: {}
|
||||
persistence:
|
||||
pvc-vol:
|
||||
enabled: true
|
||||
type: pvc
|
||||
asserts:
|
||||
- documentIndex: &deploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: pvc-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-pvc-vol
|
||||
|
||||
- it: should pass with pvc volume with existing claim
|
||||
set:
|
||||
workload:
|
||||
workload-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec: {}
|
||||
persistence:
|
||||
pvc-vol:
|
||||
enabled: true
|
||||
type: pvc
|
||||
existingClaim: some-existing-claim
|
||||
asserts:
|
||||
- documentIndex: &deploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: pvc-vol
|
||||
persistentVolumeClaim:
|
||||
claimName: some-existing-claim
|
||||
59
library/common-test/tests/pod/volume_smb-pv-pvc_test.yaml
Normal file
59
library/common-test/tests/pod/volume_smb-pv-pvc_test.yaml
Normal file
@@ -0,0 +1,59 @@
|
||||
suite: pod smb-pv-pvc volume test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with smb-pv-pvc volume
|
||||
set:
|
||||
workload:
|
||||
workload-name1:
|
||||
enabled: true
|
||||
primary: true
|
||||
type: Deployment
|
||||
podSpec: {}
|
||||
persistence:
|
||||
my-volume1:
|
||||
enabled: true
|
||||
type: smb-pv-pvc
|
||||
server: my-server
|
||||
share: my-share
|
||||
username: my-user
|
||||
password: my-pass
|
||||
my-volume2:
|
||||
enabled: true
|
||||
type: smb-pv-pvc
|
||||
server: my-server2
|
||||
share: my-share2
|
||||
username: my-user2
|
||||
password: my-pass2
|
||||
asserts:
|
||||
- documentIndex: &pvDoc 1
|
||||
isKind:
|
||||
of: PersistentVolume
|
||||
- documentIndex: *pvDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: release-name-common-test-my-volume1-1117390590
|
||||
- documentIndex: &otherPvDoc 4
|
||||
isKind:
|
||||
of: PersistentVolume
|
||||
- documentIndex: *otherPvDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: release-name-common-test-my-volume2-1335560034
|
||||
- documentIndex: &deploymentDoc 6
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: my-volume1
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-my-volume1-1117390590
|
||||
- documentIndex: *deploymentDoc
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: my-volume2
|
||||
persistentVolumeClaim:
|
||||
claimName: release-name-common-test-my-volume2-1335560034
|
||||
Reference in New Issue
Block a user