patch common ingress service name bug (#625)

This commit is contained in:
Kjeld Schouten-Lebbing 2021-06-30 15:31:48 +02:00 committed by GitHub
parent fa79272bd7
commit 85319fd8d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 10 deletions

View File

@ -18,4 +18,4 @@ maintainers:
name: common
sources:
type: library
version: 6.4.0
version: 6.4.1

View File

@ -19,7 +19,7 @@ Renders the Service objects required by the chart.
{{- end }}
{{/*
Return the name of the primary service object
Return the primary service object
*/}}
{{- define "common.service.primary" -}}
{{- $enabledServices := dict -}}

View File

@ -3,7 +3,8 @@ This template serves as a blueprint for all Ingress objects that are created
within the common library.
*/}}
{{- define "common.classes.ingress" -}}
{{- $ingressName := include "common.names.fullname" . -}}
{{- $fullName := include "common.names.fullname" . -}}
{{- $ingressName := $fullName -}}
{{- $values := .Values.ingress -}}
{{- if hasKey . "ObjectValues" -}}
@ -16,9 +17,13 @@ within the common library.
{{- $ingressName = printf "%v-%v" $ingressName $values.nameOverride -}}
{{- end -}}
{{- $primaryService := get .Values.service (include "common.service.primary" .) }}
{{- $primaryPort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}}
{{- $name := include "common.names.name" . -}}
{{- $primaryService := get .Values.service (include "common.service.primary" .) -}}
{{- $defaultServiceName := $fullName -}}
{{- if and (hasKey $primaryService "nameOverride") $primaryService.nameOverride -}}
{{- $defaultServiceName = printf "%v-%v" $defaultServiceName $primaryService.nameOverride -}}
{{- end -}}
{{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}}
{{- $isStable := include "common.capabilities.ingress.isStable" . }}
{{- $fixedMiddlewares := "" }}
@ -79,11 +84,11 @@ spec:
http:
paths:
{{- range .paths }}
{{- $service := $name -}}
{{- $port := $primaryPort.port -}}
{{- $service := $defaultServiceName -}}
{{- $port := $defaultServicePort.port -}}
{{- if .service -}}
{{- $service = default $name .service.name -}}
{{- $port = default $primaryPort.port .service.port -}}
{{- $service = default $service .service.name -}}
{{- $port = default $port .service.port -}}
{{- end }}
- path: {{ tpl .path $ | quote }}
{{- if $isStable }}