mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
102 lines
2.8 KiB
YAML
102 lines
2.8 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: container - fields - args
|
|
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:
|
|
- notExists:
|
|
path: spec.template.spec.containers[0].args
|
|
|
|
- it: single string should pass
|
|
set:
|
|
controllers.main.containers.main.args: sleep infinity
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- sleep infinity
|
|
|
|
- it: multiline string should pass
|
|
set:
|
|
controllers.main.containers.main.args: |
|
|
echo hello
|
|
echo world
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- |-
|
|
echo hello
|
|
echo world
|
|
|
|
- it: single quoted string should pass
|
|
set:
|
|
controllers.main.containers.main.args: "sleep infinity"
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- sleep infinity
|
|
|
|
- it: list of strings should pass
|
|
set:
|
|
controllers.main.containers.main.args:
|
|
- sleep
|
|
- infinity
|
|
- "test"
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- sleep
|
|
- infinity
|
|
- test
|
|
|
|
- it: args from defaultContainerOptions should pass
|
|
set:
|
|
controllers.main.defaultContainerOptions:
|
|
args: value_of_args
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- value_of_args
|
|
|
|
- it: args from defaultContainerOptions with container override should pass
|
|
set:
|
|
controllers.main.defaultContainerOptions:
|
|
args: value_of_args
|
|
controllers.main.containers.main.args:
|
|
- value 1
|
|
- value 2
|
|
documentSelector:
|
|
path: $[?(@.kind == "Deployment")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.template.spec.containers[0].args
|
|
value:
|
|
- value 1
|
|
- value 2
|