helm-charts/charts/library/common-test/tests/container/name_test.yaml
2024-03-15 08:33:07 +00:00

54 lines
1.4 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: container name
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: with explicit name should pass
set:
controllers.main.containers:
main:
nameOverride: template-test
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].name
value: template-test
- it: with implicit name should pass
set:
controllers.main.containers:
main:
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].name
value: main
- it: with templated name should pass
set:
controllers.main.containers:
main:
nameOverride: "{{ .Release.Name }}-container"
image:
repository: ghcr.io/mendhak/http-https-echo
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].name
value: RELEASE-NAME-container