helm-charts/charts/library/common/test-chart/unittests/cronjob/field_restartPolicy_test.yaml
Bernd Schorgers a01a89cb13
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
2025-05-16 08:55:14 +02:00

30 lines
940 B
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: cronjob - fields - restartPolicy
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
set:
controllers.main.type: cronjob
controllers.main.cronjob.schedule: "*/20 * * * *"
tests:
- it: default configuration should pass
documentSelector:
path: $[?(@.kind == "CronJob")].metadata.name
value: release-name
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: Never
- it: custom configuration should pass
set:
controllers.main.pod.restartPolicy: OnFailure
documentSelector:
path: $[?(@.kind == "CronJob")].metadata.name
value: release-name
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: OnFailure