From f562712ebc0d5fa2a1b22af31fcc81a67df1460b Mon Sep 17 00:00:00 2001 From: yahel2410 Date: Tue, 28 May 2024 14:41:00 +0300 Subject: [PATCH] Support templates in ingress host (#121) --- charts/localstack/templates/NOTES.txt | 2 +- charts/localstack/templates/ingress.yaml | 4 ++-- charts/localstack/test-values.yaml | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/charts/localstack/templates/NOTES.txt b/charts/localstack/templates/NOTES.txt index 0ec939e..3132aae 100644 --- a/charts/localstack/templates/NOTES.txt +++ b/charts/localstack/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ (tpl $host.host $) }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} diff --git a/charts/localstack/templates/ingress.yaml b/charts/localstack/templates/ingress.yaml index 054f206..f02f4e2 100644 --- a/charts/localstack/templates/ingress.yaml +++ b/charts/localstack/templates/ingress.yaml @@ -30,14 +30,14 @@ spec: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ tpl . $ | quote }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} + - host: {{ tpl .host $ | quote }} http: paths: {{- range .paths }} diff --git a/charts/localstack/test-values.yaml b/charts/localstack/test-values.yaml index 519b54f..3c7a456 100644 --- a/charts/localstack/test-values.yaml +++ b/charts/localstack/test-values.yaml @@ -28,6 +28,15 @@ mountDind: forceTLS: true +ingressHost: chart-example.local +ingress: + enabled: true + hosts: + - host: "{{ .Values.ingressHost }}" + paths: + - path: / + pathType: ImplementationSpecific + # enable localstack pro (don't forget to set your API key) # image: # repository: localstack/localstack-pro