feat(common): Release common 4.0.0 (#398)

Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
Bernd Schorgers 2025-05-16 08:40:39 +02:00
parent 1e210f43e3
commit a01a89cb13
No known key found for this signature in database
327 changed files with 11181 additions and 7330 deletions

View file

@ -1,112 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc datasource
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.config:
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: default should pass
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSource
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSourceRef
- it: with dataSource should pass
set:
persistence.config:
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: spec.dataSource
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSourceRef
- it: templated dataSource name should pass
set:
persistence.config:
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: "{{ .Release.Name }}-config"
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: spec.dataSource
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: RELEASE-NAME-config
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSourceRef
- it: with dataSourceRef should pass
set:
persistence.config:
dataSourceRef:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: spec.dataSourceRef
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSource
- it: templated dataSourceRef name should pass
set:
persistence.config:
dataSourceRef:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: "{{ .Release.Name }}-config"
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: spec.dataSourceRef
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: RELEASE-NAME-config
- documentIndex: *PersistentVolumeClaimDocument
notExists:
path: spec.dataSource

View file

@ -0,0 +1,60 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - fields - datasourceRef
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.config:
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: default should pass
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- notExists:
path: spec.dataSourceRef
- it: with dataSourceRef should pass
set:
persistence.config:
dataSourceRef:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- equal:
path: spec.dataSourceRef
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
- notExists:
path: spec.dataSource
- it: templated dataSourceRef name should pass
set:
persistence.config:
dataSourceRef:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: "{{ .Release.Name }}-config"
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- equal:
path: spec.dataSourceRef
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: RELEASE-NAME-config
- notExists:
path: spec.dataSource

View file

@ -0,0 +1,60 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - fields - datasource
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.config:
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: default should pass
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- notExists:
path: spec.dataSource
- it: with dataSource should pass
set:
persistence.config:
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- equal:
path: spec.dataSource
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: MySnapshot
- notExists:
path: spec.dataSourceRef
- it: templated dataSource name should pass
set:
persistence.config:
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: "{{ .Release.Name }}-config"
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- equal:
path: spec.dataSource
value:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: RELEASE-NAME-config
- notExists:
path: spec.dataSourceRef

View file

@ -1,6 +1,6 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc storageclass
suite: pvc - fields - storageclass
templates:
- common.yaml
values:
@ -12,24 +12,22 @@ set:
tests:
- it: default should pass
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
notExists:
- notExists:
path: spec.storageClassName
- it: custom should pass
set:
persistence.config:
storageClass: custom
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
- equal:
path: spec.storageClassName
value: custom
@ -37,11 +35,10 @@ tests:
set:
persistence.config:
storageClass: "-"
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
- equal:
path: spec.storageClassName
value: ""

View file

@ -0,0 +1,50 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - metadata - annotations
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.test:
type: persistentVolumeClaim
suffix: test
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: no annotations are set by default
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- notExists:
path: metadata.annotations
- it: custom annotations
set:
persistence.test.annotations:
test_annotation: test
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- equal:
path: metadata.annotations
value:
test_annotation: test
- it: custom annotations mixed with global annotations
set:
global.annotations:
global_annotation: test
persistence.test.annotations:
test_annotation: test
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test

View file

@ -0,0 +1,63 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - metadata - labels
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.test:
type: persistentVolumeClaim
suffix: test
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: default labels
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- it: custom labels
set:
persistence.test.labels:
test_label: test
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
test_label: test
- it: custom labels mixed with global labels
set:
global.labels:
global_label: test
persistence.test.labels:
test_label: test
documentSelector:
path: $[?(@.kind == "PersistentVolumeClaim")].metadata.name
value: release-name-test
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: common-test-1.0.0
test_label: test

View file

@ -0,0 +1,189 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - metadata - name
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.main:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: name defaults to chart fullName
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name
any: true
- it: forceRename
set:
persistence.main.forceRename: forceRename
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: forcerename
any: true
- it: forceRename with template
set:
persistence.main.forceRename: "{{ .Chart.Name }}"
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: common-test
any: true
- it: prefix
set:
persistence.main.prefix: prefix
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: prefix-release-name
any: true
- it: prefix with template
set:
persistence.main.prefix: "{{ .Chart.Name }}"
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: common-test-release-name
any: true
- it: suffix
set:
persistence.main.suffix: suffix
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-suffix
any: true
- it: suffix with template
set:
persistence.main.suffix: "{{ .Chart.Name }}"
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-common-test
any: true
- it: both prefix and suffix
set:
persistence.main.prefix: prefix
persistence.main.suffix: suffix
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: prefix-release-name-suffix
any: true
- it: prefix, suffix and forceRename (illegal combination)
set:
persistence.main.forceRename: forceRename
persistence.main.prefix: prefix
persistence.main.suffix: suffix
asserts:
- failedTemplate:
errorPattern: "values don't meet the specifications of the schema"
- it: multiple items
set:
persistence.second:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-main
any: true
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-second
any: true
- it: multiple items with prefix
set:
persistence.second:
prefix: prefix
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-main
any: true
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: prefix-release-name-second
any: true
- it: multiple items with suffix
set:
persistence.second:
suffix: suffix
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-main
any: true
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-second-suffix
any: true
- it: multiple items with prefix and suffix
set:
persistence.second:
prefix: prefix
suffix: suffix
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-main
any: true
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: prefix-release-name-second-suffix
any: true
- it: multiple items with prefix, suffix and forceRename (illegal combination)
set:
persistence.second:
forceRename: forceRename
prefix: prefix
suffix: suffix
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- failedTemplate:
errorPattern: "values don't meet the specifications of the schema"

View file

@ -1,110 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc metadata
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.config:
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: default should pass
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
notExists:
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: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- it: retain enabled should pass
set:
persistence.config:
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: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
- it: custom metadata should pass
set:
persistence.config:
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: RELEASE-NAME
helm.sh/chart: common-test-1.0.0
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
persistence.config:
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: RELEASE-NAME
global_label: test
helm.sh/chart: common-test-1.0.0
test_label: test

View file

@ -1,67 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc names
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
persistence.config:
accessMode: ReadWriteOnce
size: 1Gi
tests:
- it: disabled should pass
set:
persistence.config.enabled: false
asserts:
- hasDocuments:
count: 1
- documentIndex: 0
not: true
isKind:
of: PersistentVolumeClaim
- it: enabled should pass
set:
persistence.config.enabled: true
asserts:
- hasDocuments:
count: 2
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: 1
not: true
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-config
- it: without suffix should pass
set:
persistence.config:
nameOverride: "-"
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME
- it: with custom suffix should pass
set:
persistence.config:
nameOverride: "custom"
asserts:
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-custom

View file

@ -0,0 +1,52 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc - presence
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: pvc is enabled by default
set:
persistence.test:
type: persistentVolumeClaim
suffix: test
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-test
any: true
- it: pvc can be explicitly enabled
set:
persistence.test:
type: persistentVolumeClaim
enabled: true
suffix: test
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-test
any: true
- it: pvc can be disabled
set:
persistence.test:
type: persistentVolumeClaim
enabled: false
suffix: test
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- not: true
containsDocument:
kind: PersistentVolumeClaim
apiVersion: v1
name: release-name-test
any: true

View file

@ -1,56 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: pvc values
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default enabled should pass
set:
persistence.test:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- hasDocuments:
count: 2
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-test
- it: explicit enabled should pass
set:
persistence.test:
enabled: true
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- hasDocuments:
count: 2
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-test
- it: explicit disabled
set:
persistence.test:
enabled: false
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
asserts:
- hasDocuments:
count: 1
- documentIndex: &PersistentVolumeClaimDocument 0
isKind:
of: Deployment