Skip to content

Commit

Permalink
Add labels to aggregate appwrapper editor/viewer role RBACs (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss authored Oct 31, 2024
1 parent 20bd912 commit e206010
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions config/default/editor_role_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: editor-role
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
4 changes: 4 additions & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- path: manager_webhook_patch.yaml

# Add aggregate labels to rbacs
- path: editor_role_patch.yaml
- path: viewer_role_patch.yaml
6 changes: 6 additions & 0 deletions config/default/viewer_role_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: viewer-role
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/created-by: appwrapper
app.kubernetes.io/part-of: appwrapper
app.kubernetes.io/managed-by: kustomize
name: appwrapper-editor-role
name: editor-role
rules:
- apiGroups:
- workload.codeflare.dev
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ resources:
- leader_election_role.yaml
- leader_election_role_binding.yaml
- user_role.yaml
- editor_role.yaml
- viewer_role.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/created-by: appwrapper
app.kubernetes.io/part-of: appwrapper
app.kubernetes.io/managed-by: kustomize
name: appwrapper-viewer-role
name: viewer-role
rules:
- apiGroups:
- workload.codeflare.dev
Expand Down

0 comments on commit e206010

Please sign in to comment.