mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
90 lines
2.1 KiB
YAML
90 lines
2.1 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: ingress tls
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/ingress_main_default_hosts.yaml
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: default should pass
|
|
asserts:
|
|
- documentIndex: &IngressDocument 1
|
|
isKind:
|
|
of: Ingress
|
|
- documentIndex: *IngressDocument
|
|
notExists:
|
|
path: spec.tls
|
|
|
|
- it: tls enabled should pass
|
|
set:
|
|
ingress.main:
|
|
tls:
|
|
- secretName: test
|
|
hosts:
|
|
- hostname
|
|
asserts:
|
|
- documentIndex: &IngressDocument 1
|
|
isKind:
|
|
of: Ingress
|
|
- documentIndex: *IngressDocument
|
|
equal:
|
|
path: spec.tls[0]
|
|
value:
|
|
secretName: test
|
|
hosts:
|
|
- hostname
|
|
|
|
- it: tls enabled without secret should pass
|
|
set:
|
|
ingress.main:
|
|
tls:
|
|
- hosts:
|
|
- hostname
|
|
asserts:
|
|
- documentIndex: &IngressDocument 1
|
|
isKind:
|
|
of: Ingress
|
|
- documentIndex: *IngressDocument
|
|
equal:
|
|
path: spec.tls[0]
|
|
value:
|
|
hosts:
|
|
- hostname
|
|
|
|
- it: tls enabled with secret template should pass
|
|
set:
|
|
ingress.main:
|
|
tls:
|
|
- secretName: "{{ .Release.Name }}-secret"
|
|
hosts:
|
|
- hostname
|
|
asserts:
|
|
- documentIndex: &IngressDocument 1
|
|
isKind:
|
|
of: Ingress
|
|
- documentIndex: *IngressDocument
|
|
equal:
|
|
path: spec.tls[0]
|
|
value:
|
|
secretName: RELEASE-NAME-secret
|
|
hosts:
|
|
- hostname
|
|
|
|
- it: tls enabled with secret template evaluate empty should pass
|
|
set:
|
|
ingress.main:
|
|
tls:
|
|
- secretName: '{{ "" }}'
|
|
hosts:
|
|
- hostname
|
|
asserts:
|
|
- documentIndex: &IngressDocument 1
|
|
isKind:
|
|
of: Ingress
|
|
- documentIndex: *IngressDocument
|
|
equal:
|
|
path: spec.tls[0]
|
|
value:
|
|
hosts:
|
|
- hostname
|