From 0a0362cb24fd6c56d648398c6a5315bbfc59c4fb Mon Sep 17 00:00:00 2001 From: "Alexis.GIORKALLOS" Date: Mon, 9 Sep 2024 14:28:33 +0200 Subject: [PATCH] feat: paste extraPaths entire content instead of reparsing the whole thing --- jupyterhub/templates/ingress.yaml | 16 +++------------- tools/templates/lint-and-validate-values.yaml | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/jupyterhub/templates/ingress.yaml b/jupyterhub/templates/ingress.yaml index ab05edf091..090b2ed5fb 100644 --- a/jupyterhub/templates/ingress.yaml +++ b/jupyterhub/templates/ingress.yaml @@ -24,19 +24,9 @@ spec: name: {{ include "jupyterhub.proxy-public.fullname" $ }} port: name: http - {{- range $path := $.Values.ingress.extraPaths }} - - path: {{ $path.path }} - pathType: {{ $path.pathType }} - backend: - service: - name: {{ $path.backend.service.name }} - port: - {{- if $path.backend.service.port.number }} - number: {{ $path.backend.service.port.number }} - {{- else if $path.backend.service.port.name }} - name: {{ $path.backend.service.port.name }} - {{- end }} - {{- end }} + {{- with $.Values.ingress.extraPaths }} + {{- . | toYaml | nindent 10 }} + {{- end }} {{- if $host }} host: {{ $host | quote }} {{- end }} diff --git a/tools/templates/lint-and-validate-values.yaml b/tools/templates/lint-and-validate-values.yaml index 2c6de57ab3..5af74b65af 100644 --- a/tools/templates/lint-and-validate-values.yaml +++ b/tools/templates/lint-and-validate-values.yaml @@ -574,6 +574,21 @@ ingress: - mocked2.domain.name pathSuffix: dummy-pathSuffix pathType: ImplementationSpecific + extraPaths: + - pathType: Prefix + path: "/foo" + backend: + service: + name: foo + port: + number: 80 + - pathType: Prefix + path: "/bar" + backend: + service: + name: bar + port: + name: barPort tls: - secretName: jupyterhub-tls hosts: