Skip to content

Commit

Permalink
Fix module reconciler not being able to watch for ConfigMaps error (r…
Browse files Browse the repository at this point in the history
…h-ecosystem-edge#179)

This fix adds the watch permission for ConfigMaps to the Module
reconciler, in order to be able to successfully client.Get() the build
Dockerfile ConfigMap. This client.Get() fails because the
contoller-runtime client reads from its cache, instead of directly from
the API server. The client needs the watch permission, in order to be
able to build its cache.

- kubernetes-sigs/controller-runtime#1156

Signed-off-by: Michail Resvanis <[email protected]>

Signed-off-by: Michail Resvanis <[email protected]>

Upstream-Commit: dedee81
  • Loading branch information
mresvanis committed Dec 2, 2022
1 parent 8d5bd47 commit 5386fca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ rules:
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
2 changes: 1 addition & 1 deletion controllers/module_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewModuleReconciler(
//+kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=create;delete;get;list;patch;watch
//+kubebuilder:rbac:groups="core",resources=nodes,verbs=get;list;watch
//+kubebuilder:rbac:groups="core",resources=secrets,verbs=get;list;watch
//+kubebuilder:rbac:groups="core",resources=configmaps,verbs=get;list
//+kubebuilder:rbac:groups="core",resources=configmaps,verbs=get;list;watch
//+kubebuilder:rbac:groups="core",resources=serviceaccounts,verbs=create;delete;get;list;patch;watch
//+kubebuilder:rbac:groups=security.openshift.io,resources=securitycontextconstraints,verbs=use,resourceNames=privileged
//+kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=rolebindings,verbs=create;delete;get;list;patch;watch
Expand Down

0 comments on commit 5386fca

Please sign in to comment.