Files
chart/library/common-test/tests/persistence/pvc_metadata_test.yaml
Stavros Kois 1e5e1b8ef8 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
2023-08-24 17:40:31 +03:00

90 lines
2.6 KiB
YAML

suite: pvc metadata test
templates:
- common.yaml
chart:
appVersion: &appVer v9.9.9
tests:
- it: should pass with pvc created with labels and annotations
set:
label1: label1
label2: global_label2
annotation1: annotation1
annotation2: global_annotation2
global:
labels:
g_label1: global_label1
g_label2: "{{ .Values.label2 }}"
annotations:
g_annotation1: global_annotation1
g_annotation2: "{{ .Values.annotation2 }}"
persistence:
my-volume1:
enabled: true
labels:
label1: "{{ .Values.label1 }}"
label2: label2
annotations:
annotation1: "{{ .Values.annotation1 }}"
annotation2: annotation2
type: pvc
asserts:
- documentIndex: &pvcDoc 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *pvcDoc
isAPIVersion:
of: v1
- documentIndex: *pvcDoc
equal:
path: metadata.annotations
value:
annotation1: annotation1
annotation2: annotation2
g_annotation1: global_annotation1
g_annotation2: global_annotation2
- documentIndex: *pvcDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: RELEASE-NAME
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
app.kubernetes.io/name: common-test
g_label1: global_label1
g_label2: global_label2
label1: label1
label2: label2
- it: should pass with pvc created with retain set to true
set:
persistence:
my-volume1:
enabled: true
type: pvc
retain: true
asserts:
- documentIndex: *pvcDoc
isKind:
of: PersistentVolumeClaim
- documentIndex: *pvcDoc
equal:
path: metadata.annotations
value:
"helm.sh/resource-policy": keep
- documentIndex: *pvcDoc
equal:
path: metadata.labels
value:
app: common-test-1.0.0
release: RELEASE-NAME
helm-revision: "0"
helm.sh/chart: common-test-1.0.0
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: *appVer
app.kubernetes.io/name: common-test