Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Render control plane ingress spec as template in helm chart #2289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ metadata:
{{ toYaml .Values.controlPlane.ingress.labels | indent 4 }}
{{- end }}
spec:
{{- if .Values.controlPlane.ingress.spec }}
{{ toYaml .Values.controlPlane.ingress.spec | indent 2 }}
{{- with .Values.controlPlane.ingress.spec }}
{{- tpl (toYaml .) $ | nindent 2 }}
{{- end }}
{{- if not .Values.controlPlane.ingress.spec.rules }}
rules:
Expand Down
28 changes: 28 additions & 0 deletions chart/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,31 @@ tests:
- ingress-demo.example.com
secretName: ingress-demo-tls

- it: template ingress spec
set:
controlPlane:
ingress:
enabled: true
host: my-host
spec:
tls:
- hosts:
- ingress-demo.example.com
secretName: '{{ .Release.Name }}-ingress-demo-tls'
asserts:
- hasDocuments:
count: 1
- lengthEqual:
path: spec.tls
count: 1
- equal:
path: spec.rules[0].host
value: my-host
- contains:
path: spec.tls
count: 1
content:
hosts:
- ingress-demo.example.com
secretName: RELEASE-NAME-ingress-demo-tls