fix service protocol tpl

This commit is contained in:
Stavros kois
2023-02-10 17:15:07 +02:00
parent cfed7dd3ef
commit fd6cc1e54c
3 changed files with 5 additions and 2 deletions
@@ -70,6 +70,7 @@ tests:
global:
addMetalLBAnnotations: true
addTraefikAnnotations: true
proto: HTTPS
service:
my-service1:
enabled: true
@@ -79,7 +80,7 @@ tests:
port-name:
enabled: true
primary: true
protocol: HTTPS
protocol: "{{ .Values.proto }}"
port: 12345
workload:
my-workload:
@@ -30,7 +30,7 @@ objectData: The service data, that will be used to render the Service object.
{{- range $portName, $port := $objectData.ports -}}
{{- if $port.enabled -}}
{{- if eq ($port.protocol | default "") "HTTPS" -}}
{{- if eq (tpl ($port.protocol | default "") $rootCtx) "HTTPS" -}}
{{- $hasHTTPSPort = true -}}
{{- end -}}
@@ -57,6 +57,8 @@ containers:
{{- $_ := set $container "name" $name -}}
{{- $_ := set $container "shortName" $containerName -}}
{{- $_ := set $container "podShortName" $objectData.shortName -}}
{{- $_ := set $container "podPrimary" $objectData.primary -}}
{{- include "ix.v1.common.lib.pod.container" (dict "rootCtx" $rootCtx "objectData" $container) | trim | nindent 2 }}
{{- end -}}
{{- end -}}