Skip to content

Commit d75fb72

Browse files
author
Scott Nichols
committed
fixing rbac roles.
1 parent 2d06837 commit d75fb72

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@ ko resolve -f config \
5151
| sed "s/default/${NAMESPACE}/" \
5252
| kubectl apply -n $NAMESPACE --filename -
5353
```
54+
55+
56+
### TODO:
57+
58+
- [ ] Get Deployments working when broker is the sink.
59+
- [ ] Work with owner ref graphs.

config/rbac.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ subjects:
9797
- kind: ServiceAccount
9898
name: n3wscott-graph
9999
namespace: default
100-
- kind: ServiceAccount
101-
name: n3wscott-graph
102-
namespace: default
103100

104101
---
105102

@@ -109,11 +106,29 @@ metadata:
109106
name: n3wscott-graph-resolver
110107
subjects:
111108
- kind: ServiceAccount
112-
name: controller
113-
namespace: n3wscott-graph
109+
name: n3wscott-graph
110+
namespace: default
114111
# An aggregated ClusterRole for all Addressable CRDs.
115112
# Ref: https://github.com/knative/eventing/blob/master/config/200-addressable-resolvers-clusterrole.yaml
116113
roleRef:
117114
apiGroup: rbac.authorization.k8s.io
118115
kind: ClusterRole
119116
name: addressable-resolver
117+
118+
---
119+
120+
apiVersion: rbac.authorization.k8s.io/v1
121+
kind: ClusterRoleBinding
122+
metadata:
123+
name: n3wscott-graph-source-observer
124+
subjects:
125+
- kind: ServiceAccount
126+
name: n3wscott-graph
127+
namespace: default
128+
# An aggregated ClusterRole for all Source CRDs.
129+
roleRef:
130+
apiGroup: rbac.authorization.k8s.io
131+
kind: ClusterRole
132+
name: source-observer
133+
134+
---

pkg/knative/extensions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func (c *Client) SourceCRDs() []apiextensions.CustomResourceDefinition {
4242

4343
func crdsToGVR(crds []apiextensions.CustomResourceDefinition) []schema.GroupVersionResource {
4444
gvrs := make([]schema.GroupVersionResource, 0)
45+
log.Println("Source GVRs ----")
4546
for _, crd := range crds {
4647
for _, v := range crd.Spec.Versions {
4748
if !v.Served {
@@ -54,6 +55,7 @@ func crdsToGVR(crds []apiextensions.CustomResourceDefinition) []schema.GroupVers
5455
Resource: crd.Spec.Names.Plural,
5556
}
5657
gvrs = append(gvrs, gvr)
58+
log.Printf(" %v", gvr)
5759
}
5860
}
5961
return gvrs

0 commit comments

Comments
 (0)