mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
13 lines
594 B
Smarty
13 lines
594 B
Smarty
{{/*
|
|
Return a Route object by its Identifier.
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.route.getByIdentifier" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $identifier := .id -}}
|
|
{{- $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)) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|