mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release 3.5.0 (#357)
Co-authored-by: Lawrence Gil <lawrence.gil@assemblyglobal.com>
This commit is contained in:
parent
5a722abfa9
commit
90e6b9e7cf
42 changed files with 1092 additions and 164 deletions
|
@ -0,0 +1,12 @@
|
|||
{{/*
|
||||
Return a Role Object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.role.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
|
||||
{{- $roleValues := dig $identifier nil $rootContext.Values.rbac.roles -}}
|
||||
{{- if not (empty $roleValues) -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $roleValues) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
18
charts/library/common/templates/lib/role/_validate.tpl
Normal file
18
charts/library/common/templates/lib/role/_validate.tpl
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{/*
|
||||
Validate Role values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.role.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $roleValues := .object -}}
|
||||
{{- $type := required "The role needs to have an explicitly declared type" $roleValues.type -}}
|
||||
{{- $typeList := list "Role" "ClusterRole" -}}
|
||||
{{- $rules := $roleValues.rules -}}
|
||||
|
||||
{{- if not (mustHas $type $typeList) -}}
|
||||
{{- fail (printf "You selected: `%s`. Type must be one of:\n%s\n" $type ($typeList|toYaml)) -}}
|
||||
{{- end -}}
|
||||
{{- if not $rules -}}
|
||||
{{- fail "Rules can't be empty" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue