Skip to content

Commit

Permalink
Quote ingress records from chart into ingress template
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
alexellis committed May 28, 2024
1 parent 250cda0 commit 93e1537
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions chart/openfaas/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{{- if .Values.ingress.enabled -}}
{{- $apiIsStable := eq (include "openfaas.ingress.isStable" .) "true" -}}
{{- $pathType := .Values.ingress.pathType | default "ImplementationSpecific" -}}
{{- $ingressSupportsPathType := eq (include "openfaas.ingress.supportsPathType" .) "true" -}}
apiVersion: {{ include "openfaas.ingress.apiVersion" . }}
kind: Ingress
metadata:
Expand All @@ -21,25 +18,8 @@ spec:
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host.host }}
http:
paths:
- path: {{ $host.path }}
{{- if and $pathType $ingressSupportsPathType }}
pathType: {{ $pathType }}
{{- end }}
backend:
{{- if $apiIsStable }}
service:
name: {{ $host.serviceName }}
port:
number: {{ $host.servicePort }}
{{- else }}
serviceName: {{ $host.serviceName }}
servicePort: {{ $host.servicePort }}
{{- end }}
{{- end -}}

{{ toYaml .Values.ingress.hosts | indent 2 }}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
Expand Down

0 comments on commit 93e1537

Please sign in to comment.