mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
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:
parent
1582fe27c4
commit
a548690b00
25 changed files with 670 additions and 56 deletions
|
@ -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
|
||||
|
|
57
charts/library/common-test/tests/controller/job_test.yaml
Normal file
57
charts/library/common-test/tests/controller/job_test.yaml
Normal 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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue