From 7ffa78bb22be1394dc781582bdfa9673d69a5945 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Tue, 28 May 2024 10:23:10 +0100 Subject: [PATCH] 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) --- chart/openfaas/templates/ingress.yaml | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/chart/openfaas/templates/ingress.yaml b/chart/openfaas/templates/ingress.yaml index 645c2f8f3..4fd905d27 100644 --- a/chart/openfaas/templates/ingress.yaml +++ b/chart/openfaas/templates/ingress.yaml @@ -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: @@ -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 }}