helm-charts/charts/library/common/test-chart/unittests/ingress/validations_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

55 lines
1.8 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: ingress - validations
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: service reference to non-existing service should fail
set:
ingress.main.hosts:
- host: "chart-example.local"
paths:
- path: /
service:
identifier: main
port: 8081
asserts:
- failedTemplate:
errorMessage: "No enabled Service found with this identifier. (ingress: 'main', path: '/', identifier: 'main')"
- it: automatic service determination should fail when no service is enabled
set:
ingress.main.hosts:
- host: "chart-example.local"
paths:
- path: /
service:
port: 8081
asserts:
- failedTemplate:
errorMessage: "Either service.name or service.identifier is required because automatic Service detection is not possible. (ingress: main, host: chart-example.local, path: /)"
- it: automatic service determination should fail when >1 service is enabled
set:
service:
main:
controller: main
ports:
ui:
port: 8082
second:
controller: main
ports:
ui:
port: 8082
ingress.main.hosts:
- host: "chart-example.local"
paths:
- path: /
service:
port: 8081
asserts:
- failedTemplate:
errorMessage: "Either service.name or service.identifier is required because automatic Service detection is not possible. (ingress: main, host: chart-example.local, path: /)"