mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common)!: Release common-3.0.0 (#284)
This commit is contained in:
parent
a27c4f6124
commit
3981facca6
16 changed files with 124 additions and 116 deletions
|
@ -56,9 +56,20 @@ spec:
|
|||
pathType: {{ default "Prefix" .pathType }}
|
||||
backend:
|
||||
service:
|
||||
{{ $service := include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .service.name) | fromYaml -}}
|
||||
{{ $service := dict -}}
|
||||
{{ $serviceName := "" -}}
|
||||
{{ $servicePort := 0 -}}
|
||||
|
||||
{{ if .service.name -}}
|
||||
{{ $serviceName = tpl .service.name $rootContext -}}
|
||||
{{ else if .service.identifier -}}
|
||||
{{ $service = (include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .service.identifier) | fromYaml ) -}}
|
||||
{{ if not $service -}}
|
||||
{{fail (printf "No service found with this identifier. (ingress: '%s', path: '%s', identifier: '%s')" $ingressObject.identifier .path .service.identifier)}}
|
||||
{{ end -}}
|
||||
{{ $serviceName = $service.name -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if empty (dig "port" nil .service) -}}
|
||||
{{/* Default to the Service primary port if no port has been specified */ -}}
|
||||
{{ if $service -}}
|
||||
|
@ -73,10 +84,10 @@ spec:
|
|||
{{ $servicePort = .service.port -}}
|
||||
{{ else if kindIs "string" .service.port -}}
|
||||
{{/* If a port name is given, try to resolve to a number */ -}}
|
||||
{{ $servicePort = include "bjw-s.common.lib.service.getPortNumberByName" (dict "rootContext" $rootContext "serviceID" .service.name "portName" .service.port) -}}
|
||||
{{ $servicePort = include "bjw-s.common.lib.service.getPortNumberByName" (dict "rootContext" $rootContext "serviceID" .service.identifier "portName" .service.port) -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
name: {{ default .service.name $service.name }}
|
||||
name: {{ default .service.name $serviceName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue