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 8520ec9 commit f08ba82
Showing 1 changed file with 6 additions and 0 deletions.
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 f08ba82

Please sign in to comment.