From a63afa36dfb4a9f3a22ce2b070af52ad20987217 Mon Sep 17 00:00:00 2001 From: Bmailhe Date: Thu, 27 Jun 2024 16:21:07 +0200 Subject: [PATCH] BUG: kubernetes-ingress: limit template spec name to 15 characters (#247) Remove "-tcp" suffix according to RFC6335. Signed-off-by: bmailhe --- kubernetes-ingress/templates/NOTES.txt | 4 ++-- kubernetes-ingress/templates/controller-daemonset.yaml | 2 +- kubernetes-ingress/templates/controller-deployment.yaml | 2 +- kubernetes-ingress/templates/controller-proxy-deployment.yaml | 2 +- kubernetes-ingress/templates/controller-service.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kubernetes-ingress/templates/NOTES.txt b/kubernetes-ingress/templates/NOTES.txt index 54105c6..ba3d01d 100644 --- a/kubernetes-ingress/templates/NOTES.txt +++ b/kubernetes-ingress/templates/NOTES.txt @@ -29,7 +29,7 @@ Service ports mapped are: protocol: UDP {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} containerPort: {{ .targetPort }} protocol: TCP {{- end }} @@ -61,7 +61,7 @@ Service ports mapped are: {{- end }} {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} containerPort: {{ .port }} protocol: TCP {{- if $useHostPort }} diff --git a/kubernetes-ingress/templates/controller-daemonset.yaml b/kubernetes-ingress/templates/controller-daemonset.yaml index 671a61b..f969aaf 100644 --- a/kubernetes-ingress/templates/controller-daemonset.yaml +++ b/kubernetes-ingress/templates/controller-daemonset.yaml @@ -168,7 +168,7 @@ spec: {{- end }} {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} containerPort: {{ .port }} protocol: TCP {{- if $useHostPort }} diff --git a/kubernetes-ingress/templates/controller-deployment.yaml b/kubernetes-ingress/templates/controller-deployment.yaml index 6653aec..6375147 100644 --- a/kubernetes-ingress/templates/controller-deployment.yaml +++ b/kubernetes-ingress/templates/controller-deployment.yaml @@ -167,7 +167,7 @@ spec: protocol: UDP {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} containerPort: {{ .targetPort }} protocol: TCP {{- end }} diff --git a/kubernetes-ingress/templates/controller-proxy-deployment.yaml b/kubernetes-ingress/templates/controller-proxy-deployment.yaml index 5a6b002..286e978 100644 --- a/kubernetes-ingress/templates/controller-proxy-deployment.yaml +++ b/kubernetes-ingress/templates/controller-proxy-deployment.yaml @@ -162,7 +162,7 @@ spec: protocol: UDP {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} containerPort: {{ .targetPort }} protocol: TCP {{- end }} diff --git a/kubernetes-ingress/templates/controller-service.yaml b/kubernetes-ingress/templates/controller-service.yaml index efb2069..eaa69a2 100644 --- a/kubernetes-ingress/templates/controller-service.yaml +++ b/kubernetes-ingress/templates/controller-service.yaml @@ -98,7 +98,7 @@ spec: {{- end }} {{- end }} {{- range .Values.controller.service.tcpPorts }} - - name: {{ .name }}-tcp + - name: {{ .name | trunc 15 | trimSuffix "-" }} port: {{ .port }} protocol: TCP targetPort: {{ .targetPort }}