mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
feat(common): Release common v4.1.0 (#416)
This commit is contained in:
parent
f3660654f4
commit
db552e2dee
52 changed files with 705 additions and 129 deletions
|
@ -0,0 +1,21 @@
|
|||
{{/*
|
||||
Autodetects the service for a Route object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.route.autoDetectService" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $routeObject := .object -}}
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{- if eq 1 (len $enabledServices) -}}
|
||||
{{- range $routeObject.rules -}}
|
||||
{{- range .backendRefs }}
|
||||
{{- $backendRef := . -}}
|
||||
{{- if and (empty (dig "name" nil $backendRef)) (empty (dig "identifier" nil $backendRef)) -}}
|
||||
{{- $_ := set $backendRef "identifier" ($enabledServices | keys | first) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $routeObject | toYaml -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue