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

@ -0,0 +1,42 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: daemonset - fields - revisionHistoryLimit
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main.type: daemonset
tests:
- it: default should pass
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: spec.revisionHistoryLimit
value: 3
- it: custom revisionHistoryLimit
set:
controllers.main:
revisionHistoryLimit: 8
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: spec.revisionHistoryLimit
value: 8
- it: explicit revisionHistoryLimit 0 should pass
set:
controllers.main:
revisionHistoryLimit: 0
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: spec.revisionHistoryLimit
value: 0

View file

@ -0,0 +1,47 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: daemonset - metadata - annotations
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main:
type: daemonset
tests:
- it: no annotations are set by default
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- notExists:
path: metadata.annotations
- it: custom annotations
set:
controllers.main.annotations:
test_annotation: test
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: metadata.annotations
value:
test_annotation: test
- it: custom annotations mixed with global annotations
set:
global.annotations:
global_annotation: test
controllers.main.annotations:
test_annotation: test
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
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: daemonset - metadata - labels
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main:
type: daemonset
tests:
- it: default labels
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/controller: main
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:
controllers.main.labels:
test_label: test
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/controller: main
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
controllers.main.labels:
test_label: test
documentSelector:
path: $[?(@.kind == "DaemonSet")].metadata.name
value: release-name
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/controller: main
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,206 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: daemonset - metadata - name
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main.type: daemonset
tests:
- it: name defaults to chart fullName
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name
any: true
- it: forceRename
set:
controllers.main.forceRename: forceRename
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: forcerename
any: true
- it: forceRename with template
set:
controllers.main.forceRename: "{{ .Chart.Name }}"
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: common-test
any: true
- it: prefix
set:
controllers.main.prefix: prefix
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: prefix-release-name
any: true
- it: prefix with template
set:
controllers.main.prefix: "{{ .Chart.Name }}-prefix"
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: common-test-prefix-release-name
any: true
- it: suffix
set:
controllers.main.suffix: suffix
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-suffix
any: true
- it: suffix with template
set:
controllers.main.suffix: "{{ .Chart.Name }}-suffix"
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-common-test-suffix
any: true
- it: both prefix and suffix
set:
controllers.main.prefix: prefix
controllers.main.suffix: suffix
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: prefix-release-name-suffix
any: true
- it: prefix, suffix and forceRename (illegal combination)
set:
controllers.main.forceRename: forceRename
controllers.main.prefix: prefix
controllers.main.suffix: suffix
asserts:
- failedTemplate:
errorPattern: "values don't meet the specifications of the schema"
- it: multiple items
set:
controllers:
second:
type: daemonset
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-main
any: true
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-second
any: true
- it: multiple items with prefix
set:
controllers:
second:
type: daemonset
prefix: prefix
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-main
any: true
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: prefix-release-name-second
any: true
- it: multiple items with suffix
set:
controllers:
second:
type: daemonset
suffix: suffix
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-main
any: true
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-second-suffix
any: true
- it: multiple items with prefix and suffix
set:
controllers:
second:
type: daemonset
prefix: prefix
suffix: suffix
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: release-name-main
any: true
- containsDocument:
kind: DaemonSet
apiVersion: apps/v1
name: prefix-release-name-second-suffix
any: true
- it: multiple items with prefix, suffix and forceRename (illegal combination)
set:
controllers:
second:
type: daemonset
forceRename: forceRename
prefix: prefix
suffix: suffix
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- failedTemplate:
errorPattern: "values don't meet the specifications of the schema"