helm-chart/unittests/ingress/ingress.tpl.yaml

46 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-05 14:48:17 +02:00
suite: Test ingress tpl use
templates:
- templates/gitea/ingress.yaml
tests:
2024-07-05 14:48:17 +02:00
- it: Ingress Class using TPL
set:
2024-07-05 14:48:17 +02:00
global.ingress.className: "ingress-class"
ingress.className: "{{ .Values.global.ingress.className }}"
ingress.enabled: true
2024-07-05 14:48:17 +02:00
ingress.hosts[0].host: "some-host"
ingress.tls:
- secretName: gitea-tls
hosts:
2024-07-05 14:48:17 +02:00
- "some-host"
asserts:
- isKind:
of: Ingress
- equal:
path: spec.tls[0].hosts[0]
2024-07-05 14:48:17 +02:00
value: "some-host"
- equal:
path: spec.rules[0].host
2024-07-05 14:48:17 +02:00
value: "some-host"
- equal:
path: spec.ingressClassName
value: "ingress-class"
- it: hostname using TPL
set:
2024-07-05 14:48:17 +02:00
global.giteaHostName: "gitea.example.com"
ingress.enabled: true
2024-07-05 14:48:17 +02:00
ingress.hosts[0].host: "{{ .Values.global.giteaHostName }}"
ingress.tls:
- secretName: gitea-tls
hosts:
2024-07-05 14:48:17 +02:00
- "{{ .Values.global.giteaHostName }}"
asserts:
- isKind:
of: Ingress
- equal:
path: spec.tls[0].hosts[0]
2024-07-05 14:48:17 +02:00
value: "gitea.example.com"
- equal:
path: spec.rules[0].host
2024-07-05 14:48:17 +02:00
value: "gitea.example.com"