Skip to content

Commit 649188c

Browse files
authored
Merge pull request #745 from dipti-pai/fixrbac
Fix RBAC role generation for IAC
2 parents 168d33c + c1c5cc1 commit 649188c

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ dev-deploy: manifests
139139
rm -rf config/dev
140140

141141
manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc.
142+
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config="config/crd/bases"
142143
cd api; $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config="../config/crd/bases"
143144

144145
api-docs: gen-crd-api-reference-docs ## Generate API reference documentation

config/rbac/role.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
1-
21
---
32
apiVersion: rbac.authorization.k8s.io/v1
43
kind: ClusterRole
54
metadata:
6-
creationTimestamp: null
75
name: manager-role
86
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- events
11+
verbs:
12+
- create
13+
- patch
14+
- apiGroups:
15+
- ""
16+
resources:
17+
- secrets
18+
verbs:
19+
- get
20+
- list
21+
- watch
22+
- apiGroups:
23+
- image.toolkit.fluxcd.io
24+
resources:
25+
- imagepolicies
26+
verbs:
27+
- get
28+
- list
29+
- watch
30+
- apiGroups:
31+
- image.toolkit.fluxcd.io
32+
resources:
33+
- imagepolicies/status
34+
verbs:
35+
- get
936
- apiGroups:
1037
- image.toolkit.fluxcd.io
1138
resources:

internal/controller/imageupdateautomation_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ func getPatchOptions(ownedConditions []string, controllerName string) []patch.Op
9292

9393
// +kubebuilder:rbac:groups=image.toolkit.fluxcd.io,resources=imageupdateautomations,verbs=get;list;watch;create;update;patch;delete
9494
// +kubebuilder:rbac:groups=image.toolkit.fluxcd.io,resources=imageupdateautomations/status,verbs=get;update;patch
95+
// +kubebuilder:rbac:groups=image.toolkit.fluxcd.io,resources=imagepolicies,verbs=get;list;watch
96+
// +kubebuilder:rbac:groups=image.toolkit.fluxcd.io,resources=imagepolicies/status,verbs=get
9597
// +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=gitrepositories,verbs=get;list;watch
98+
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch
99+
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch
96100

97101
// ImageUpdateAutomationReconciler reconciles a ImageUpdateAutomation object
98102
type ImageUpdateAutomationReconciler struct {

0 commit comments

Comments
 (0)