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,95 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: cronjob configuration
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default cronjob configuration should pass
set:
controllers.main.type: cronjob
controllers.main.cronjob.schedule: "*/20 * * * *"
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.suspend
value: false
- documentIndex: *ControllerDoc
equal:
path: spec.schedule
value: "*/20 * * * *"
- documentIndex: *ControllerDoc
equal:
path: spec.concurrencyPolicy
value: Forbid
- documentIndex: *ControllerDoc
equal:
path: spec.successfulJobsHistoryLimit
value: 1
- documentIndex: *ControllerDoc
equal:
path: spec.failedJobsHistoryLimit
value: 1
- documentIndex: *ControllerDoc
notExists:
path: spec.jobTemplate.spec.ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: Never
- it: custom cronjob configuration should pass
set:
controllers:
main:
type: cronjob
pod:
restartPolicy: OnFailure
cronjob:
suspend: &CronJobSuspended true
schedule: &CronJobSchedule "0 3 * * *"
concurrencyPolicy: &CronJobConcurrencyPolicy "Test"
failedJobsHistory: &CronJobFailedJobsHistory 2
successfulJobsHistory: &CronJobSuccessfulJobsHistory 3
ttlSecondsAfterFinished: &ttlSecondsAfterFinished 3600
parallelism: &CronJobParallelism 3
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.suspend
value: *CronJobSuspended
- documentIndex: *ControllerDoc
equal:
path: spec.schedule
value: *CronJobSchedule
- documentIndex: *ControllerDoc
equal:
path: spec.concurrencyPolicy
value: *CronJobConcurrencyPolicy
- documentIndex: *ControllerDoc
equal:
path: spec.successfulJobsHistoryLimit
value: *CronJobSuccessfulJobsHistory
- documentIndex: *ControllerDoc
equal:
path: spec.failedJobsHistoryLimit
value: *CronJobFailedJobsHistory
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.ttlSecondsAfterFinished
value: *ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: OnFailure
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.parallelism
value: *CronJobParallelism

View file

@ -1,16 +1,16 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller defaultContainerOptions
suite: controller - fields - defaultContainerOptions
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default should pass
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
notExists:
path: spec.template.spec.containers[0].resources
@ -25,12 +25,11 @@ tests:
controllers.main.containers.main.resources:
requests:
memory: 2Gi
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
@ -47,12 +46,11 @@ tests:
controllers.main.containers.main.resources:
requests:
memory: 2Gi
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
@ -69,12 +67,11 @@ tests:
controllers.main.containers.main.resources:
requests:
memory: 2Gi
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
@ -92,18 +89,16 @@ tests:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
memory: 1Gi
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.initContainers[0].resources
value:
requests:
@ -121,16 +116,14 @@ tests:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
documentSelector:
path: $[?(@.kind == "Deployment")].metadata.name
value: release-name
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
memory: 1Gi
- documentIndex: 0
notExists:
- notExists:
path: spec.template.spec.initContainers[0].resources

View file

@ -1,130 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller revisionHistoryLimit
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
# Deployment
- it: default should pass for Deployment
set:
controllers.main.type: deployment
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 3
- it: custom revisionHistoryLimit should pass for Deployment
set:
controllers.main:
type: deployment
revisionHistoryLimit: 8
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 8
- it: explicit revisionHistoryLimit 0 should pass for Deployment
set:
controllers.main:
type: deployment
revisionHistoryLimit: 0
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 0
# StatefulSet
- it: default should pass for StatefulSet
set:
controllers.main.type: statefulset
asserts:
- documentIndex: 0
isKind:
of: StatefulSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 3
- it: custom revisionHistoryLimit should pass for StatefulSet
set:
controllers.main:
type: statefulset
revisionHistoryLimit: 8
asserts:
- documentIndex: 0
isKind:
of: StatefulSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 8
- it: explicit revisionHistoryLimit 0 should pass for StatefulSet
set:
controllers.main:
type: statefulset
revisionHistoryLimit: 0
asserts:
- documentIndex: 0
isKind:
of: StatefulSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 0
# DaemonSet
- it: default should pass for DaemonSet
set:
controllers.main.type: daemonset
asserts:
- documentIndex: 0
isKind:
of: DaemonSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 3
- it: custom revisionHistoryLimit should pass for DaemonSet
set:
controllers.main:
type: daemonset
revisionHistoryLimit: 8
asserts:
- documentIndex: 0
isKind:
of: DaemonSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 8
- it: explicit revisionHistoryLimit 0 should pass for DaemonSet
set:
controllers.main:
type: daemonset
revisionHistoryLimit: 0
asserts:
- documentIndex: 0
isKind:
of: DaemonSet
- documentIndex: 0
equal:
path: spec.revisionHistoryLimit
value: 0

View file

@ -1,65 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: job configuration
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default job configuration should pass
set:
controllers:
main:
type: job
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
equal:
path: spec.suspend
value: false
- documentIndex: *ControllerDoc
notExists:
path: spec.ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.template.spec.restartPolicy
value: Never
- it: custom job configuration should pass
set:
controllers:
main:
type: job
pod:
restartPolicy: OnFailure
job:
suspend: &JobSuspended true
ttlSecondsAfterFinished: &ttlSecondsAfterFinished 3600
backoffLimit: 3
parallelism: &JobParallelism 3
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
equal:
path: spec.suspend
value: *JobSuspended
- documentIndex: *ControllerDoc
equal:
path: spec.ttlSecondsAfterFinished
value: *ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.template.spec.restartPolicy
value: OnFailure
- documentIndex: *ControllerDoc
equal:
path: spec.backoffLimit
value: 3
- documentIndex: *ControllerDoc
equal:
path: spec.parallelism
value: *JobParallelism

View file

@ -1,123 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata cronjob
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main.cronjob.schedule: "*/20 * * * *"
tests:
- it: default metadata should pass
set:
controllers.main.type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
notExists:
path: metadata.annotations
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata should pass
set:
controllers:
main:
type: cronjob
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controllers:
main:
type: cronjob
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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
- it: jobTemplate metadata should pass
set:
controllers:
main:
type: cronjob
pod:
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.metadata.labels
value:
app.kubernetes.io/component: main
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
test_label: test

View file

@ -1,92 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata daemonset
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default metadata should pass
set:
controllers.main.type: daemonset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
notExists:
path: metadata.annotations
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata should pass
set:
controllers:
main:
type: daemonset
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controllers:
main:
type: daemonset
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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

@ -1,92 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata deployment
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default metadata should pass
set:
controllers.main.type: deployment
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
notExists:
path: metadata.annotations
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata should pass
set:
controllers:
main:
type: deployment
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controllers:
main:
type: deployment
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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

@ -1,120 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata job
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default metadata should pass
set:
controllers.main.type: job
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
notExists:
path: metadata.annotations
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata should pass
set:
controllers:
main:
type: job
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controllers:
main:
type: job
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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
- it: jobTemplate metadata should pass
set:
controllers:
main:
type: job
pod:
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
equal:
path: spec.template.metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: spec.template.metadata.labels
value:
app.kubernetes.io/component: main
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
test_label: test

View file

@ -1,92 +0,0 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata statefulset
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default metadata should pass
set:
controllers.main.type: statefulset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
notExists:
path: metadata.annotations
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata should pass
set:
controllers:
main:
type: statefulset
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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 metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controllers:
main:
type: statefulset
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: metadata.labels
value:
app.kubernetes.io/component: 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,47 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller - presence
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default should pass
asserts:
- containsDocument:
apiVersion: apps/v1
kind: Deployment
name: release-name
any: true
- it: multiple controllers should pass
set:
controllers:
second:
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- containsDocument:
apiVersion: apps/v1
kind: Deployment
name: release-name-main
any: true
- containsDocument:
apiVersion: apps/v1
kind: Deployment
name: release-name-second
any: true
- it: disabled should pass
set:
controllers.main.enabled: false
asserts:
- not: true
containsDocument:
apiVersion: apps/v1
kind: Deployment
name: release-name
any: true

View file

@ -1,138 +1,56 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller types
suite: controller - types
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default should pass
- it: should default to Deployment
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *deploymentDoc
equal:
path: metadata.labels['app.kubernetes.io/component']
value: main
- it: additional controllers should pass
set:
controllers:
second:
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- hasDocuments:
count: 2
- documentIndex: &firstDeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *firstDeploymentDoc
equal:
path: metadata.name
value: RELEASE-NAME-main
- documentIndex: *firstDeploymentDoc
equal:
path: metadata.labels['app.kubernetes.io/component']
value: main
- documentIndex: &secondDeploymentDoc 1
isKind:
of: Deployment
- documentIndex: *secondDeploymentDoc
equal:
path: metadata.name
value: RELEASE-NAME-second
- documentIndex: *secondDeploymentDoc
equal:
path: metadata.labels['app.kubernetes.io/component']
value: second
- it: additional controllers with nameOverride should pass
set:
controllers:
main:
nameOverride: "{{ .Release.Name }}"
second:
nameOverride: testOverride
containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
asserts:
- hasDocuments:
count: 2
- documentIndex: &firstDeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *firstDeploymentDoc
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *firstDeploymentDoc
equal:
path: metadata.labels['app.kubernetes.io/component']
value: main
- documentIndex: &secondDeploymentDoc 1
isKind:
of: Deployment
- documentIndex: *secondDeploymentDoc
equal:
path: metadata.name
value: RELEASE-NAME-testOverride
- documentIndex: *secondDeploymentDoc
equal:
path: metadata.labels['app.kubernetes.io/component']
value: second
- containsDocument:
apiVersion: apps/v1
kind: Deployment
name: release-name
any: true
- it: daemonset should pass
set:
controllers.main.type: daemonset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- containsDocument:
apiVersion: apps/v1
kind: DaemonSet
name: release-name
any: true
- it: statefulset should pass
set:
controllers.main.type: statefulset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- containsDocument:
apiVersion: apps/v1
kind: StatefulSet
name: release-name
any: true
- it: cronjob should pass
set:
controllers.main.type: cronjob
controllers.main.cronjob.schedule: "*/20 * * * *"
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- containsDocument:
apiVersion: batch/v1
kind: CronJob
name: release-name
any: true
- it: disabled should pass
- it: job should pass
set:
controllers.main.enabled: false
controllers.main.type: job
asserts:
- hasDocuments:
count: 0
- containsDocument:
apiVersion: batch/v1
kind: Job
name: release-name
any: true