mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
feat(common): Release 2.0.0 (#189)
This commit is contained in:
parent
8a42d212af
commit
98677d85b2
56 changed files with 1192 additions and 1804 deletions
|
@ -54,13 +54,28 @@ spec:
|
|||
backend:
|
||||
service:
|
||||
{{ $service := include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .service.name) | fromYaml -}}
|
||||
{{ $servicePrimaryPort := dict -}}
|
||||
{{ if $service -}}
|
||||
{{ $servicePrimaryPort = include "bjw-s.common.lib.service.primaryPort" (dict "rootContext" $rootContext "serviceObject" $service) | fromYaml -}}
|
||||
{{ $servicePort := 0 -}}
|
||||
|
||||
{{ if eq (dig "port" nil .service) nil -}}
|
||||
{{/* Default to the Service primary port if no port has been specified */ -}}
|
||||
{{ if $service -}}
|
||||
{{ $defaultServicePort := include "bjw-s.common.lib.service.primaryPort" (dict "rootContext" $rootContext "serviceObject" $service) | fromYaml -}}
|
||||
{{ if $defaultServicePort -}}
|
||||
{{ $servicePort = $defaultServicePort.port -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{/* If a port number is given, use that */ -}}
|
||||
{{ if kindIs "float64" .service.port -}}
|
||||
{{ $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) -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
name: {{ default .service.name $service.name }}
|
||||
port:
|
||||
number: {{ default .service.port $servicePrimaryPort.port }}
|
||||
number: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue