Skip to content

Commit e206010

Browse files
authored
Add labels to aggregate appwrapper editor/viewer role RBACs (#261)
1 parent 20bd912 commit e206010

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: editor-role
5+
labels:
6+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
7+
rbac.authorization.k8s.io/aggregate-to-admin: "true"

config/default/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ patches:
3535
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
3636
# crd/kustomization.yaml
3737
- path: manager_webhook_patch.yaml
38+
39+
# Add aggregate labels to rbacs
40+
- path: editor_role_patch.yaml
41+
- path: viewer_role_patch.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: viewer-role
5+
labels:
6+
rbac.authorization.k8s.io/aggregate-to-view: "true"

config/rbac/appwrapper_editor_role.yaml renamed to config/rbac/editor_role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/created-by: appwrapper
1010
app.kubernetes.io/part-of: appwrapper
1111
app.kubernetes.io/managed-by: kustomize
12-
name: appwrapper-editor-role
12+
name: editor-role
1313
rules:
1414
- apiGroups:
1515
- workload.codeflare.dev

config/rbac/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ resources:
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
1212
- user_role.yaml
13+
- editor_role.yaml
14+
- viewer_role.yaml
1315
# Comment the following 4 lines if you want to disable
1416
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
1517
# which protects your /metrics endpoint.

config/rbac/appwrapper_viewer_role.yaml renamed to config/rbac/viewer_role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/created-by: appwrapper
1010
app.kubernetes.io/part-of: appwrapper
1111
app.kubernetes.io/managed-by: kustomize
12-
name: appwrapper-viewer-role
12+
name: viewer-role
1313
rules:
1414
- apiGroups:
1515
- workload.codeflare.dev

0 commit comments

Comments
 (0)