Skip to content

Commit

Permalink
Refactor managedcluster-import-role.yaml
Browse files Browse the repository at this point in the history
- Updated ClusterRole and ClusterRoleBinding names to remove the 'system:' prefix for consistency.
- Removed the 'update' verb from the ClusterRole rules.
- Added new rules for 'clusters' resource under 'cluster.x-k8s.io' in managedcluster-import-role.yaml.

Signed-off-by: xuezhaojun <[email protected]>
  • Loading branch information
xuezhaojun committed Jan 21, 2025
1 parent 715c8cd commit 5f73866
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:open-cluster-management:managedcluster:bootstrap:agent-registration
name: open-cluster-management:managedcluster:bootstrap:agent-registration
rules:
- apiGroups:
- ""
Expand All @@ -25,7 +25,6 @@ rules:
verbs:
- get
- create
- update
- apiGroups: # this is needed for creating managed cluster from agent-side.
- "cluster.open-cluster-management.io"
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: 'system:open-cluster-management:managedcluster:bootstrap:agent-registration'
name: 'open-cluster-management:managedcluster:bootstrap:agent-registration'
subjects:
- kind: ServiceAccount
name: agent-registration-bootstrap
namespace: '{{ .Values.global.namespace }}'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'system:open-cluster-management:managedcluster:bootstrap:agent-registration'
name: 'open-cluster-management:managedcluster:bootstrap:agent-registration'
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,10 @@ rules:
- get
- list
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- clusters
verbs:
- get
- list

0 comments on commit 5f73866

Please sign in to comment.