You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2018/11/16 13:17:59 UTC
[camel-k] 02/02: (chore) rename knative subscriptions in sources
and add doc
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 77d53a2c84d8aebf015d7f653db3e478648b8def
Author: nferraro <ni...@gmail.com>
AuthorDate: Fri Nov 16 14:06:21 2018 +0100
(chore) rename knative subscriptions in sources and add doc
---
docs/traits.adoc | 23 ++++++++++++++++++++++-
pkg/trait/knative.go | 10 +++++-----
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/docs/traits.adoc b/docs/traits.adoc
index 27f90b2..130958e 100644
--- a/docs/traits.adoc
+++ b/docs/traits.adoc
@@ -62,6 +62,28 @@ The following is a list of common traits that can be configured by the end users
+
It's enabled by default.
+| deployment
+| Kubernetes, OpenShift
+| Creates a standard Kubernetes deployment for running the integration.
+ +
+ +
+ It's enabled by default on vanilla Kubernetes/Openshift profiles.
+
+| knative
+| Knative (Kubernetes, Openshift)
+| Creates Knative resources to run the integration instead of the standard Kubernetes resources.
+ +
+ +
+ It's enabled by default when the Knative profile is active.
+
+[cols="m,"]
+!===
+
+! knative.sources
+! Configures a (comma-separated) list of channels to which the Knative service must be subscribed (to receive cloudevents from a channel).
+
+!===
+
| service
| Kubernetes, OpenShift
| Exposes the integration with a Service resource so that it can be accessed by other applications (or integrations) in the same namespace.
@@ -117,6 +139,5 @@ There are also platform traits that **normally should not be configured** by the
[options="header",cols="m,,"]
|=======================
| Trait | Profiles | Description
-| deployment | Kubernetes, OpenShift | Creates the basic Kubernetes resource needed for running the integration.
| owner | Kubernetes, OpenShift | Makes sure that every resource created by the traits belongs to the integration custom resource (so they are deleted when the integration is deleted).
|=======================
diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index a8d083f..2175525 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -31,8 +31,8 @@ import (
)
type knativeTrait struct {
- BaseTrait `property:",squash"`
- Subscriptions string `property:"subscriptions"`
+ BaseTrait `property:",squash"`
+ Sources string `property:"sources"`
}
func newKnativeTrait() *knativeTrait {
@@ -42,9 +42,9 @@ func newKnativeTrait() *knativeTrait {
}
func (t *knativeTrait) autoconfigure(environment *environment, resources *kubernetes.Collection) error {
- if t.Subscriptions == "" {
+ if t.Sources == "" {
channels := t.getSourceChannels(environment)
- t.Subscriptions = strings.Join(channels, ",")
+ t.Sources = strings.Join(channels, ",")
}
return nil
}
@@ -198,7 +198,7 @@ func (t *knativeTrait) getConfiguration(e *environment) knativeutil.CamelEnviron
func (t *knativeTrait) getConfiguredSourceChannels() []string {
channels := make([]string, 0)
- for _, ch := range strings.Split(t.Subscriptions, ",") {
+ for _, ch := range strings.Split(t.Sources, ",") {
cht := strings.Trim(ch, " \t\"")
if cht != "" {
channels = append(channels, cht)