mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47: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 }}
|
||||
|
|
|
@ -7,6 +7,10 @@ within the common library.
|
|||
{{- $routeObject := .object -}}
|
||||
|
||||
{{- $routeKind := $routeObject.kind | default "HTTPRoute" -}}
|
||||
{{- $apiVersion := "gateway.networking.k8s.io/v1alpha2" -}}
|
||||
{{- if $rootContext.Capabilities.APIVersions.Has (printf "gateway.networking.k8s.io/v1beta1/%s" $routeKind) }}
|
||||
{{- $apiVersion = "gateway.networking.k8s.io/v1beta1" -}}
|
||||
{{- end -}}
|
||||
{{- $labels := merge
|
||||
($routeObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
|
@ -16,7 +20,7 @@ within the common library.
|
|||
(include "bjw-s.common.lib.metadata.globalAnnotations" $rootContext | fromYaml)
|
||||
-}}
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1alpha2
|
||||
apiVersion: {{ $apiVersion }}
|
||||
{{- if and (ne $routeKind "GRPCRoute") (ne $routeKind "HTTPRoute") (ne $routeKind "TCPRoute") (ne $routeKind "TLSRoute") (ne $routeKind "UDPRoute") }}
|
||||
{{- fail (printf "Not a valid route kind (%s)" $routeKind) }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue