Skip to content

Commit

Permalink
Fix #668: add documentation and enable automatically the feature with…
Browse files Browse the repository at this point in the history
… more than 2 channels
  • Loading branch information
nicolaferraro authored and lburgazzoli committed May 23, 2019
1 parent ab773de commit 0572195
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/traits.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ More information can be found in the official Kubernetes documentation about htt
! knative.endpoint-sinks
! Configures a (comma-separated) list of endpoints the Knative consumes.

! knative.filter-source-channels
! Force the knative endpoint to filter messages based on the `ce-knativehistory` header (Knative experimental feature). It's enabled automatically when there are more than 2 source channels. It's optional (default to false) when there's a single source channel.

!===

| istio
Expand Down
6 changes: 4 additions & 2 deletions pkg/trait/knative.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ func (t *knativeTrait) Configure(e *Environment) (bool, error) {

t.EndpointSinks = strings.Join(items, ",")
}
if t.FilterSourceChannels == nil && len(strings.Split(t.ChannelSources, ",")) > 1 {
// Filter channels when the integration subscribes to more than one
if len(strings.Split(t.ChannelSources, ",")) > 1 {
// Always filter channels when the integration subscribes to more than one
// Using Knative experimental header: https://github.com/knative/eventing/blob/master/pkg/provisioners/message.go#L28
// TODO: filter automatically all source channels when the feature becomes stable
filter := true
t.FilterSourceChannels = &filter
}
Expand Down

0 comments on commit 0572195

Please sign in to comment.