Skip to content

Commit

Permalink
rename bootstrap sa and rbac (#802)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <[email protected]>
  • Loading branch information
zhiweiyin318 authored Jan 16, 2025
1 parent 54a9764 commit a44b44e
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:open-cluster-management:bootstrap
name: open-cluster-management:bootstrap
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-bootstrap
name: open-cluster-management:bootstrap:managedcluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:open-cluster-management:bootstrap
name: open-cluster-management:bootstrap
subjects:
- kind: Group
apiGroup: rbac.authorization.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: cluster-bootstrap
name: agent-registration-bootstrap
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-bootstrap-sa
name: open-cluster-management:bootstrap:agent-registration
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:open-cluster-management:bootstrap
name: open-cluster-management:bootstrap
subjects:
- kind: ServiceAccount
name: cluster-bootstrap
name: agent-registration-bootstrap
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
- system:bootstrap:bootstrap-token-ocmhub
{{- end }}
{{- if .Values.createBootstrapSA }}
- system:serviceaccount:open-cluster-management:cluster-bootstrap
- system:serviceaccount:{{ .Release.Namespace }}:agent-registration-bootstrap
{{- end }}
{{- end }}
{{- with .Values.clusterManager.registrationConfiguration.featureGates }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rules:
- apiGroups: [""]
resources: ["serviceaccounts/token"]
resourceNames:
- "cluster-bootstrap"
- "agent-registration-bootstrap"
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods"]
Expand Down
2 changes: 1 addition & 1 deletion deploy/cluster-manager/config/rbac/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rules:
- apiGroups: [""]
resources: ["serviceaccounts/token"]
resourceNames:
- "cluster-bootstrap"
- "agent-registration-bootstrap"
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
- apiGroups:
- ""
resourceNames:
- cluster-bootstrap
- agent-registration-bootstrap
resources:
- serviceaccounts/token
verbs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rules:
- apiGroups: [""]
resources: ["serviceaccounts/token"]
resourceNames:
- "cluster-bootstrap"
- "agent-registration-bootstrap"
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods"]
Expand Down
2 changes: 1 addition & 1 deletion pkg/registration/hub/importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const (
operatorNamesapce = "open-cluster-management"
bootstrapSA = "cluster-bootstrap"
bootstrapSA = "agent-registration-bootstrap"
ManagedClusterConditionImported = "Imported"
)

Expand Down

0 comments on commit a44b44e

Please sign in to comment.