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:57 UTC

[camel-k] branch master updated (1131b37 -> 77d53a2)

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

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


    from 1131b37  runtime: small improvement to the dependency lister plugin
     new 0064989  Fix #226: set correct build dir for Kaniko
     new 77d53a2  (chore) rename knative subscriptions in sources and add doc

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/traits.adoc             | 23 ++++++++++++++++++++++-
 pkg/builder/builder.go       |  6 +++++-
 pkg/builder/builder_types.go |  1 +
 pkg/builder/kaniko/kaniko.go |  3 +++
 pkg/platform/build.go        |  1 +
 pkg/trait/knative.go         | 10 +++++-----
 6 files changed, 37 insertions(+), 7 deletions(-)


[camel-k] 01/02: Fix #226: set correct build dir for Kaniko

Posted by nf...@apache.org.
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 0064989b9360898aab22fadd84cb9210d9852dac
Author: nferraro <ni...@gmail.com>
AuthorDate: Fri Nov 16 14:05:17 2018 +0100

    Fix #226: set correct build dir for Kaniko
---
 pkg/builder/builder.go       | 6 +++++-
 pkg/builder/builder_types.go | 1 +
 pkg/builder/kaniko/kaniko.go | 3 +++
 pkg/platform/build.go        | 1 +
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/pkg/builder/builder.go b/pkg/builder/builder.go
index 1b452b4..430933b 100644
--- a/pkg/builder/builder.go
+++ b/pkg/builder/builder.go
@@ -124,7 +124,11 @@ func (b *defaultBuilder) submit(request Request) {
 	r.Task.StartedAt = time.Now()
 
 	// create tmp path
-	builderPath, err := ioutil.TempDir(os.TempDir(), "builder-")
+	buildDir := request.BuildDir
+	if buildDir == "" {
+		buildDir = os.TempDir()
+	}
+	builderPath, err := ioutil.TempDir(buildDir, "builder-")
 	if err != nil {
 		r.Status = StatusError
 		r.Error = err
diff --git a/pkg/builder/builder_types.go b/pkg/builder/builder_types.go
index f4cd9b8..6b97c1e 100644
--- a/pkg/builder/builder_types.go
+++ b/pkg/builder/builder_types.go
@@ -85,6 +85,7 @@ type Request struct {
 	Code         v1alpha1.SourceSpec
 	Dependencies []string
 	Steps        []Step
+	BuildDir     string
 }
 
 // Task --
diff --git a/pkg/builder/kaniko/kaniko.go b/pkg/builder/kaniko/kaniko.go
index 318958f..4cf6754 100644
--- a/pkg/builder/kaniko/kaniko.go
+++ b/pkg/builder/kaniko/kaniko.go
@@ -28,3 +28,6 @@ var DefaultSteps = []builder.Step{
 	builder.NewStep("packager", 30, builder.StandardPackager),
 	builder.NewStep("publisher", 40, Publisher),
 }
+
+// BuildDir is the directory where to build artifacts (shared with the Kaniko pod)
+var BuildDir = "/workspace"
\ No newline at end of file
diff --git a/pkg/platform/build.go b/pkg/platform/build.go
index 7b6332a..d0a8c0e 100644
--- a/pkg/platform/build.go
+++ b/pkg/platform/build.go
@@ -64,6 +64,7 @@ func NewBuildRequest(ctx context.Context, context *v1alpha1.IntegrationContext)
 		req.Steps = s2i.DefaultSteps
 	} else if SupportsKanikoPublishStrategy(p) {
 		req.Steps = kaniko.DefaultSteps
+		req.BuildDir = kaniko.BuildDir
 	} else {
 		return req, errors.New("unsupported platform configuration")
 	}


[camel-k] 02/02: (chore) rename knative subscriptions in sources and add doc

Posted by nf...@apache.org.
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)