Skip to content

Commit 7ffa78b

Browse files
committed
Quote ingress records from chart into ingress template
The previous template was too closely tied to the beta version of ingress to work with the new format and layout of ingress v1. Instead of trying to remap values from custom fields in the values.yaml file, this version quotes the text directly meaning it works better for the newer format. Tested e2e with a KinD cluster and inlets. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 250cda0 commit 7ffa78b

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

chart/openfaas/templates/ingress.yaml

+2-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{{- if .Values.ingress.enabled -}}
2-
{{- $apiIsStable := eq (include "openfaas.ingress.isStable" .) "true" -}}
3-
{{- $pathType := .Values.ingress.pathType | default "ImplementationSpecific" -}}
4-
{{- $ingressSupportsPathType := eq (include "openfaas.ingress.supportsPathType" .) "true" -}}
52
apiVersion: {{ include "openfaas.ingress.apiVersion" . }}
63
kind: Ingress
74
metadata:
@@ -21,25 +18,8 @@ spec:
2118
ingressClassName: {{ .Values.ingress.ingressClassName }}
2219
{{- end }}
2320
rules:
24-
{{- range $host := .Values.ingress.hosts }}
25-
- host: {{ $host.host }}
26-
http:
27-
paths:
28-
- path: {{ $host.path }}
29-
{{- if and $pathType $ingressSupportsPathType }}
30-
pathType: {{ $pathType }}
31-
{{- end }}
32-
backend:
33-
{{- if $apiIsStable }}
34-
service:
35-
name: {{ $host.serviceName }}
36-
port:
37-
number: {{ $host.servicePort }}
38-
{{- else }}
39-
serviceName: {{ $host.serviceName }}
40-
servicePort: {{ $host.servicePort }}
41-
{{- end }}
42-
{{- end -}}
21+
22+
{{ toYaml .Values.ingress.hosts | indent 2 }}
4323
{{- if .Values.ingress.tls }}
4424
tls:
4525
{{ toYaml .Values.ingress.tls | indent 4 }}

0 commit comments

Comments
 (0)