mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
* fix(common): fix incorrect route default values (#91) * fix(common): make `sectionName` optional for route parentRefs * fix(common): name primary route correctly * feat(common): add controller.type of cronjob (#87) * fix(common): Fix invalid persistence type message (#85) * feat(common): Allow setting container restartPolicy Co-authored-by: András Maróy <andras@maroy.hu> Co-authored-by: loeken <loeken@internetz.me> Co-authored-by: Han Cen <hi@chamburr.com>
21 lines
602 B
Smarty
21 lines
602 B
Smarty
{{/* Return the name of the primary route object */}}
|
|
{{- define "bjw-s.common.lib.route.primary" -}}
|
|
{{- $enabledRoutes := dict -}}
|
|
{{- range $name, $route := .Values.route -}}
|
|
{{- if $route.enabled -}}
|
|
{{- $_ := set $enabledRoutes $name . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- $result := "" -}}
|
|
{{- range $name, $route := $enabledRoutes -}}
|
|
{{- if and (hasKey $route "primary") $route.primary -}}
|
|
{{- $result = $name -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- if not $result -}}
|
|
{{- $result = keys $enabledRoutes | first -}}
|
|
{{- end -}}
|
|
{{- $result -}}
|
|
{{- end -}}
|