mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e210f43e3
commit
a01a89cb13
327 changed files with 11181 additions and 7330 deletions
|
@ -4,9 +4,7 @@ Renders RBAC objects required by the chart.
|
|||
{{- define "bjw-s.common.render.rbac" -}}
|
||||
{{- $rootContext := . -}}
|
||||
{{- include "bjw-s.common.render.rbac.roles" (dict "rootContext" $rootContext) -}}
|
||||
|
||||
{{- include "bjw-s.common.render.rbac.roleBindings" (dict "rootContext" $rootContext) -}}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{/*
|
||||
|
@ -14,27 +12,16 @@ Renders RBAC Role objects required by the chart.
|
|||
*/}}
|
||||
{{- define "bjw-s.common.render.rbac.roles" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- /* Generate named Roles as required */ -}}
|
||||
{{- range $key, $role := $rootContext.Values.rbac.roles }}
|
||||
{{- /* Enable role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $enabledRoles := (include "bjw-s.common.lib.rbac.role.enabledRoles" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRoles -}}
|
||||
{{- /* Generate object from the raw role values */ -}}
|
||||
{{- $roleObject := (include "bjw-s.common.lib.rbac.role.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $roleValues := (mustDeepCopy $role) -}}
|
||||
{{- /* Perform validations on the role before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rbac.role.validate" (dict "rootContext" $rootContext "object" $roleObject) -}}
|
||||
|
||||
{{- /* Create object from the raw role values */ -}}
|
||||
{{- $roleObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $roleValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the role before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rbac.role.validate" (dict "rootContext" $rootContext "object" $roleObject) -}}
|
||||
|
||||
{{/* Include the role class */}}
|
||||
{{- include "bjw-s.common.class.rbac.Role" (dict "rootContext" $rootContext "object" $roleObject) | nindent 0 -}}
|
||||
|
||||
{{- end -}}
|
||||
{{/* Include the role class */}}
|
||||
{{- include "bjw-s.common.class.rbac.Role" (dict "rootContext" $rootContext "object" $roleObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -43,25 +30,12 @@ Renders RBAC RoleBinding objects required by the chart.
|
|||
*/}}
|
||||
{{- define "bjw-s.common.render.rbac.roleBindings" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- range $key, $roleBinding := $rootContext.Values.rbac.bindings }}
|
||||
{{- /* Enable RoleBinding by default, but allow override */ -}}
|
||||
{{- $roleBindingEnabled := true -}}
|
||||
{{- if hasKey $roleBinding "enabled" -}}
|
||||
{{- $roleBindingEnabled = $roleBinding.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $enabledRoleBindings := (include "bjw-s.common.lib.rbac.roleBinding.enabledRoleBindings" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRoleBindings -}}
|
||||
{{- /* Generate object from the raw role values */ -}}
|
||||
{{- $roleBindingObject := (include "bjw-s.common.lib.rbac.roleBinding.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- if $roleBindingEnabled -}}
|
||||
{{- $roleBindingValues := (mustDeepCopy $roleBinding) -}}
|
||||
|
||||
{{- /* Create object from the raw RoleBinding values */ -}}
|
||||
{{- $roleBindingObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $roleBindingValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the RoleBinding before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rbac.roleBinding.validate" (dict "rootContext" $rootContext "object" $roleBindingObject) -}}
|
||||
|
||||
{{/* Include the RoleBinding class */}}
|
||||
{{- include "bjw-s.common.class.rbac.roleBinding" (dict "rootContext" $rootContext "object" $roleBindingObject) | nindent 0 -}}
|
||||
|
||||
{{- end -}}
|
||||
{{/* Include the RoleBinding class */}}
|
||||
{{- include "bjw-s.common.class.rbac.roleBinding" (dict "rootContext" $rootContext "object" $roleBindingObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue