fix(rbac): adds resourceNames

This commit is contained in:
Stavros kois
2023-12-26 14:22:34 +02:00
parent 1e858c3e8a
commit 347f379d8f
3 changed files with 16 additions and 2 deletions

View File

@@ -35,6 +35,8 @@ tests:
- "{{ .Values.some_group }}"
resources:
- "{{ .Values.some_resource }}"
resourceNames:
- "{{ .Values.some_name }}"
verbs:
- "{{ .Values.some_verb }}"
subjects:
@@ -67,6 +69,8 @@ tests:
- apps
resources:
- deployments
resourceNames:
- some-name
verbs:
- list
- documentIndex: &roleBinding 3

View File

@@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 17.1.1
version: 17.1.2

View File

@@ -36,7 +36,17 @@ objectData: The object data to be used to render the RBAC.
{{- fail "RBAC - Expected non-empty entry in [rbac.rules.resources]" -}}
{{- end }}
- {{ tpl . $rootCtx | quote }}
{{- end -}}
{{- end -}}
{{- /* resourceNames */}}
{{- if .resourceNames -}}
resourceNames:
{{- range .resourceNames -}}
{{- if not . -}}
{{- fail "RBAC - Expected non-empty entry in <rbac.rules.resourceNames>" -}}
{{- end }}
- {{ tpl . $rootCtx | quote }}
{{- end -}}
{{- end -}}
{{- /* verbs */}}
verbs:
{{- range .verbs -}}