helm-charts/charts/library/common/templates/lib/service/_getByIdentifier.tpl
2023-09-13 11:24:23 +02:00

13 lines
466 B
Smarty

{{/*
Return a service Object by its Identifier.
*/}}
{{- define "bjw-s.common.lib.service.getByIdentifier" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}
{{- range $name, $serviceValues := $rootContext.Values.service -}}
{{- if eq $name $identifier -}}
{{- include "bjw-s.common.lib.service.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $serviceValues) -}}
{{- end -}}
{{- end -}}
{{- end -}}