feat(common): Release v2.5.0 (#258)

Co-authored-by: Maurits <75321636+maurits-funda@users.noreply.github.com>
Co-authored-by: Noam Lerner <bugok@users.noreply.github.com>
This commit is contained in:
Bernd Schorgers 2024-01-16 21:28:41 +01:00 committed by GitHub
parent 1582fe27c4
commit a548690b00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 670 additions and 56 deletions

View file

@ -13,6 +13,9 @@ tests:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
notExists:
path: spec.suspend
- documentIndex: *ControllerDoc
equal:
path: spec.schedule
@ -45,6 +48,7 @@ tests:
pod:
restartPolicy: OnFailure
cronjob:
suspend: &CronJobSuspended true
schedule: &CronJobSchedule "0 3 * * *"
concurrencyPolicy: &CronJobConcurrencyPolicy "Test"
failedJobsHistory: &CronJobFailedJobsHistory 2
@ -54,6 +58,10 @@ tests:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.suspend
value: *CronJobSuspended
- documentIndex: *ControllerDoc
equal:
path: spec.schedule

View file

@ -0,0 +1,57 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: job configuration
templates:
- common.yaml
tests:
- it: default job configuration should pass
set:
controllers:
main:
type: job
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Job
- documentIndex: *ControllerDoc
notExists:
path: spec.suspend
- 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
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

View file

@ -0,0 +1,118 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: controller metadata job
templates:
- common.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