This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 057219550833a9e6db20212198b3e9ced9e03ccc
Author: nferraro <ni.ferr...@gmail.com>
AuthorDate: Wed May 22 15:10:29 2019 +0200

    Fix #668: add documentation and enable automatically the feature with more 
than 2 channels
---
 docs/traits.adoc     | 3 +++
 pkg/trait/knative.go | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/docs/traits.adoc b/docs/traits.adoc
index 0493800..6fe5929 100644
--- a/docs/traits.adoc
+++ b/docs/traits.adoc
@@ -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
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index edad18f..6b15d24 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -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
                }

Reply via email to