mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
fix(common): Release common-4.0.1 (#415)
This commit is contained in:
parent
a01a89cb13
commit
9a478444a4
14 changed files with 163 additions and 15 deletions
|
@ -4,10 +4,26 @@ Return a Route object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.route.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- $enabledRoutes := (include "bjw-s.common.lib.route.enabledRoutes" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledRoutes $identifier) -}}
|
||||
{{- $objectValues := get $enabledRoutes $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRoutes)) -}}
|
||||
{{- $object := include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRoutes)) | fromYaml -}}
|
||||
|
||||
{{- /* Try to automatically determine the default Service identifier if needed and possible */ -}}
|
||||
{{- if eq 1 (len $enabledServices) -}}
|
||||
{{- range $object.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 -}}
|
||||
|
||||
{{- $object | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue