86 lines
2.2 KiB
YAML
86 lines
2.2 KiB
YAML
suite: test deployment
|
|
templates:
|
|
- ingress.yaml
|
|
tests:
|
|
- it: Should set Ingress host name
|
|
set:
|
|
ingress:
|
|
host: chart-example.local
|
|
tlsEnabled: true
|
|
asserts:
|
|
- equal:
|
|
path: spec.tls
|
|
value:
|
|
- hosts:
|
|
- chart-example.local
|
|
secretName: tls-release-name
|
|
- equal:
|
|
path: spec.rules
|
|
value:
|
|
- host: chart-example.local
|
|
http:
|
|
paths:
|
|
- backend:
|
|
serviceName: release-name
|
|
servicePort: 80
|
|
- it: Should conform to DNS names
|
|
set:
|
|
ingress:
|
|
host: feature/my_branch.local
|
|
tlsEnabled: true
|
|
asserts:
|
|
- equal:
|
|
path: spec.tls
|
|
value:
|
|
- hosts:
|
|
- feature-my-branch.local
|
|
secretName: tls-release-name
|
|
- equal:
|
|
path: spec.rules
|
|
value:
|
|
- host: feature-my-branch.local
|
|
http:
|
|
paths:
|
|
- backend:
|
|
serviceName: release-name
|
|
servicePort: 80
|
|
- it: Should set Ingress annotation
|
|
set:
|
|
ingress:
|
|
host: chart-example.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
asserts:
|
|
- equal:
|
|
path: metadata.annotations
|
|
value:
|
|
kubernetes.io/ingress.class: nginx
|
|
- it: Should generate multiple ingresses
|
|
set:
|
|
ingresses:
|
|
- host: chart-example.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
- host: another.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- it: Should generate multiple ingresses
|
|
set:
|
|
ingress:
|
|
host: chart-example.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
ingresses:
|
|
- host: chart-example.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
- host: another.local
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 3
|