Skip to content

Commit 4699264

Browse files
committed
Fixed rosacontrolplane_controller permissions
1 parent 7744a4b commit 4699264

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TOOLS_DIR_DEPS := $(TOOLS_DIR)/go.sum $(TOOLS_DIR)/go.mod $(TOOLS_DIR)/Makefile
3030
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
3131

3232

33-
API_DIRS := cmd/clusterawsadm/api api exp/api controlplane/eks/api bootstrap/eks/api iam/api
33+
API_DIRS := cmd/clusterawsadm/api api exp/api controlplane/eks/api bootstrap/eks/api iam/api controlplane/rosa/api
3434
API_FILES := $(foreach dir, $(API_DIRS), $(call rwildcard,../../$(dir),*.go))
3535

3636
BIN_DIR := bin
@@ -229,6 +229,7 @@ generate-go-apis: ## Alias for .build/generate-go-apis
229229
paths=./$(EXP_DIR)/controllers/... \
230230
paths=./bootstrap/eks/controllers/... \
231231
paths=./controlplane/eks/controllers/... \
232+
paths=./controlplane/rosa/controllers/... \
232233
output:crd:dir=config/crd/bases \
233234
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
234235
crd:crdVersions=v1 \

config/rbac/role.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ rules:
135135
- get
136136
- patch
137137
- update
138+
- apiGroups:
139+
- controlplane.cluster.x-k8s.io
140+
resources:
141+
- rosacontrolplanes
142+
verbs:
143+
- delete
144+
- get
145+
- list
146+
- patch
147+
- update
148+
- watch
138149
- apiGroups:
139150
- controlplane.cluster.x-k8s.io
140151
resources:
@@ -144,6 +155,14 @@ rules:
144155
- get
145156
- list
146157
- watch
158+
- apiGroups:
159+
- controlplane.cluster.x-k8s.io
160+
resources:
161+
- rosacontrolplanes/status
162+
verbs:
163+
- get
164+
- patch
165+
- update
147166
- apiGroups:
148167
- ""
149168
resources:

controlplane/rosa/controllers/rosacontrolplane_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ func (r *ROSAControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr c
9999
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status,verbs=get;list;watch
100100
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machinedeployments,verbs=get;list;watch
101101
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machinepools,verbs=get;list;watch
102+
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes,verbs=get;list;watch;update;patch;delete
103+
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes/status,verbs=get;update;patch
102104

103105
// Reconcile will reconcile RosaControlPlane Resources.
104106
func (r *ROSAControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error) {

0 commit comments

Comments
 (0)