mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
23 lines
681 B
Smarty
23 lines
681 B
Smarty
{{/*
|
|
Return the enabled RoleBindings.
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.rbac.roleBinding.enabledRoleBindings" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $enabledRoleBindings := dict -}}
|
|
|
|
{{- range $name, $role := $rootContext.Values.rbac.bindings -}}
|
|
{{- if kindIs "map" $role -}}
|
|
{{- /* Enable Role by default, but allow override */ -}}
|
|
{{- $roleEnabled := true -}}
|
|
{{- if hasKey $role "enabled" -}}
|
|
{{- $roleEnabled = $role.enabled -}}
|
|
{{- end -}}
|
|
|
|
{{- if $roleEnabled -}}
|
|
{{- $_ := set $enabledRoleBindings $name . -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- $enabledRoleBindings | toYaml -}}
|
|
{{- end -}}
|