You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/03/25 18:59:01 UTC

[camel-k] branch master updated: Fix #579: fix namespace in subscription

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


The following commit(s) were added to refs/heads/master by this push:
     new fd48662  Fix #579: fix namespace in subscription
fd48662 is described below

commit fd486628258c460f973c6bc49f52ae311bd1feab
Author: nferraro <ni...@gmail.com>
AuthorDate: Mon Mar 25 18:29:51 2019 +0100

    Fix #579: fix namespace in subscription
---
 pkg/trait/knative.go        | 2 +-
 pkg/util/knative/knative.go | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index a5380de..6c4da5d 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -145,7 +145,7 @@ func (t *knativeTrait) createConfiguration(e *Environment) error {
 func (t *knativeTrait) createSubscriptions(e *Environment) error {
 	channels := t.extractNames(t.ChannelSources)
 	for _, ch := range channels {
-		sub := knativeutil.CreateSubscription(ch, e.Integration.Name)
+		sub := knativeutil.CreateSubscription(e.Integration.Namespace, ch, e.Integration.Name)
 		e.Resources.Add(&sub)
 	}
 
diff --git a/pkg/util/knative/knative.go b/pkg/util/knative/knative.go
index d86eb61..a7290b7 100644
--- a/pkg/util/knative/knative.go
+++ b/pkg/util/knative/knative.go
@@ -47,14 +47,14 @@ func IsInstalled(ctx context.Context, c kubernetes.Interface) (bool, error) {
 }
 
 // CreateSubscription ---
-func CreateSubscription(channel string, name string) eventing.Subscription {
+func CreateSubscription(namespace string, channel string, name string) eventing.Subscription {
 	return eventing.Subscription{
 		TypeMeta: metav1.TypeMeta{
 			APIVersion: eventing.SchemeGroupVersion.String(),
 			Kind:       "Subscription",
 		},
 		ObjectMeta: metav1.ObjectMeta{
-			Namespace: name,
+			Namespace: namespace,
 			Name:      channel + "-" + name,
 		},
 		Spec: eventing.SubscriptionSpec{