Skip to content

Commit d41d827

Browse files
sonasingh46k8s-infra-cherrypick-robot
authored andcommitted
fix(rbac): add namespace list permission
This commit adds namespace list permission for capz manager as it is needed by it in case of identity reference on azurecluster object. Signed-off-by: Ashutosh Kumar <[email protected]>
1 parent e3d7f13 commit d41d827

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)