Skip to content

Commit 94fb411

Browse files
authored
Merge pull request #2092 from k8s-infra-cherrypick-robot/cherry-pick-2077-to-release-1.1
[release-1.1] fix(rbac): add namespace list permission
2 parents e3d7f13 + d41d827 commit 94fb411

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/rbac/role.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ rules:
1616
- patch
1717
- update
1818
- watch
19+
- apiGroups:
20+
- ""
21+
resources:
22+
- namespaces
23+
verbs:
24+
- list
1925
- apiGroups:
2026
- ""
2127
resources:

controllers/azurecluster_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func (acr *AzureClusterReconciler) SetupWithManager(ctx context.Context, mgr ctr
112112
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status,verbs=get;list;watch
113113
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=azuremachinetemplates;azuremachinetemplates/status,verbs=get;list;watch
114114
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=azureclusteridentities;azureclusteridentities/status,verbs=get;list;watch;create;update;patch;delete
115+
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=list;
115116

116117
// Reconcile idempotently gets, creates, and updates a cluster.
117118
func (acr *AzureClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) {

0 commit comments

Comments
 (0)