feat(common): Release 2.0.0 (#189)

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-10-02 13:21:17 +02:00 committed by GitHub
parent 8a42d212af
commit 98677d85b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 1192 additions and 1804 deletions

View file

@ -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 }}