From 74f4a18b6ae0fc9292c8879d7cd0e3442207de11 Mon Sep 17 00:00:00 2001 From: Magnus Hyllander Date: Wed, 9 Jun 2021 15:12:09 +0200 Subject: [PATCH] Restore the defaults for targetPort when not explicitly set (#26) The original intent with having separate `httpPorts` and `httpsPorts` was to be able to specify multiple ports of each kind, mapped to the `http` and `https` ports, respectively, on the haproxy-ingress pod. When the ability to set the `targetPort` was added by https://github.com/haproxy-ingress/charts/commit/00ce05399db68257bd9906c397760ed053904f52, backwards compatibility was broken by removing the defaults. Fixes #25 --- haproxy-ingress/templates/controller-service.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haproxy-ingress/templates/controller-service.yaml b/haproxy-ingress/templates/controller-service.yaml index b78efd1..e4929ee 100644 --- a/haproxy-ingress/templates/controller-service.yaml +++ b/haproxy-ingress/templates/controller-service.yaml @@ -52,7 +52,7 @@ spec: - name: "http-{{ .port }}" port: {{ .port }} protocol: TCP - targetPort: {{ .targetPort }} + targetPort: {{ .targetPort | default "http" }} {{- if (not (empty .nodePort)) }} nodePort: {{ .nodePort }} {{- end }} @@ -61,7 +61,7 @@ spec: - name: "https-{{ .port }}" port: {{ .port }} protocol: TCP - targetPort: {{ .targetPort }} + targetPort: {{ .targetPort | default "https" }} {{- if (not (empty .nodePort)) }} nodePort: {{ .nodePort }} {{- end }}