feat(common): Release version 1.2.0 (#92)

* fix(common): fix incorrect route default values (#91)
* fix(common): make `sectionName` optional for route parentRefs
* fix(common): name primary route correctly
* feat(common): add controller.type of cronjob (#87)
* fix(common): Fix invalid persistence type message (#85)
* feat(common): Allow setting container restartPolicy

Co-authored-by: András Maróy <andras@maroy.hu>
Co-authored-by: loeken <loeken@internetz.me>
Co-authored-by: Han Cen <hi@chamburr.com>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-12-05 14:36:41 +01:00 committed by GitHub
parent 8f2a1ba9b4
commit 72670526a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 351 additions and 66 deletions

View file

@ -0,0 +1,67 @@
suite: cronjob configuration
templates:
- common.yaml
tests:
- it: default cronjob configuration should pass
set:
controller:
type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- 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
equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: Never
- it: custom cronjob configuration should pass
set:
controller:
type: cronjob
restartPolicy: OnFailure
cronjob:
schedule: &CronJobSchedule "0 3 * * *"
concurrencyPolicy: &CronJobConcurrencyPolicy "Test"
failedJobsHistory: &CronJobFailedJobsHistory 2
successfulJobsHistory: &CronJobSuccessfulJobsHistory 3
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- 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.template.spec.restartPolicy
value: OnFailure

View file

@ -0,0 +1,83 @@
suite: controller metadata cronjob
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
controller.type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
isNull:
path: metadata.annotations
- documentIndex: *ControllerDoc
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: app-template-1.2.0
- it: custom metadata should pass
set:
controller:
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/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.2.0
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controller:
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/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.2.0
test_label: test

View file

@ -19,7 +19,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
- it: custom metadata should pass
set:
@ -45,7 +45,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test
- it: custom metadata with global metadata should pass
@ -79,5 +79,5 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test

View file

@ -19,7 +19,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
- it: custom metadata should pass
set:
@ -45,7 +45,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test
- it: custom metadata with global metadata should pass
@ -79,5 +79,5 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test

View file

@ -19,7 +19,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
- it: custom metadata should pass
set:
@ -45,7 +45,7 @@ tests:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test
- it: custom metadata with global metadata should pass
@ -79,5 +79,5 @@ tests:
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.1.3
helm.sh/chart: app-template-1.2.0
test_label: test

View file

@ -36,6 +36,18 @@ tests:
path: metadata.name
value: RELEASE-NAME
- it: cronjob should pass
set:
controller.type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- it: disabled should pass
set:
controller.enabled: false