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:
Stavros Kois
2023-08-24 17:40:31 +03:00
committed by GitHub
parent 18505483e5
commit 1e5e1b8ef8
35 changed files with 2083 additions and 26 deletions

View 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

View 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

View 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

View 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