Skip to content

Commit

Permalink
Add jobsinks-addressable-resolver cluster role (#8298)
Browse files Browse the repository at this point in the history
This will ensure that alld ServiceAccount that are bound to
"addressable-resolver" ClusterRole can read JobSinks.

Fixes issues like this for SinkBindings:
```
{"level":"error","ts":"2024-11-04T08:06:16.160Z","logger":"eventing-webhook","caller":"sinkbinding/sinkbinding.go:87",
"msg":"Failed to get Addressable from Destination:
%!w(*fmt.wrapError=&{failed to get lister for
sinks.knative.dev/v1alpha1,
Resource=jobsinks: jobsinks.sinks.knative.dev is forbidden:
User \"system:serviceaccount:knative-eventing:eventing-webhook\"
cannot list resource \"jobsinks\" in API group \"sinks.knative.dev\"
```
  • Loading branch information
mgencur authored Nov 4, 2024
1 parent b4b609a commit fa6b4c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ rules:
- get
- list
- watch
- apiGroups:
- sinks.knative.dev
resources:
- jobsinks
- jobsinks/status
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
22 changes: 22 additions & 0 deletions config/core/roles/addressable-resolvers-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,25 @@ rules:
- get
- list
- watch

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: jobsinks-addressable-resolver
labels:
duck.knative.dev/addressable: "true"
app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-eventing
# Do not use this role directly. These rules will be added to the "addressable-resolver" role.
rules:
- apiGroups:
- sinks.knative.dev
resources:
- jobsinks
- jobsinks/status
verbs:
- get
- list
- watch

0 comments on commit fa6b4c5

Please sign in to comment.