helm-charts/charts/other/common-chart/tests/pvc/metadata_test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs a1a80f5ff5
feat(common)!: Migrate library chart
2022-08-07 11:45:41 +02:00

106 lines
3.1 KiB
YAML

suite: pvc metadata
templates:
- common.yaml
tests:
- it: default should pass
set:
persistence.config.enabled: true
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
isNull:
path: metadata.annotations
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: retain enabled should pass
set:
persistence.config:
enabled: true
retain: true
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.annotations
value:
helm.sh/resource-policy: keep
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
persistence.config:
enabled: true
labels:
test_label: test
annotations:
test_annotation: test
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
persistence.config:
enabled: true
labels:
test_label: test
annotations:
test_annotation: test
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.annotations
value:
test_annotation: test
global_annotation: test
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: common-chart-0.1.0
test_label: test