Skip to content

Commit

Permalink
filter resource-scoped pingsources (yeah still there)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Jul 15, 2020
1 parent 2249f46 commit 3dfc311
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
16 changes: 0 additions & 16 deletions config/core/roles/pingsource-mt-adapter-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ rules:
- "get"
- "list"
- "watch"
- apiGroups:
- sources.knative.dev
resources:
- pingsources
- pingsources/status
verbs:
- get
- list
- watch
- patch
- apiGroups:
- sources.knative.dev
resources:
- pingsources/finalizers
verbs:
- "patch"
- apiGroups:
- ""
resources:
Expand Down
6 changes: 6 additions & 0 deletions pkg/adapter/mtping/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package mtping
import (
corev1 "k8s.io/api/core/v1"

"knative.dev/eventing/pkg/apis/eventing"
"knative.dev/eventing/pkg/apis/sources/v1alpha2"
)

Expand Down Expand Up @@ -50,6 +51,11 @@ type PingConfigs map[string]PingConfig
// Project creates a PingConfig for the given source
func Project(i interface{}) interface{} {
obj := i.(*v1alpha2.PingSource)

if scope, ok := obj.Annotations[eventing.ScopeAnnotationKey]; ok && scope != eventing.ScopeCluster {
return nil
}

cfg := &PingConfig{
ObjectReference: corev1.ObjectReference{
Name: obj.Name,
Expand Down

0 comments on commit 3dfc311

Please sign in to comment.