[camel] branch master updated: Upgrade Chronicle Core to version 1.16.27
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new d05a6bd Upgrade Chronicle Core to version 1.16.27 d05a6bd is described below commit d05a6bdc55395155d134549b0058843162e55ca0 Author: Andrea Cosentino AuthorDate: Wed Sep 19 07:32:33 2018 +0200 Upgrade Chronicle Core to version 1.16.27 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 31ffcad..d87adce 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -120,7 +120,7 @@ 3.2.6_1 3.2.6 1.16.26 -1.16.26 +1.16.27 1.13.27 2.4.17 1.16.5
buildbot success in on camel-site-production
The Buildbot has detected a restored build on builder camel-site-production while building . Full details are available at: https://ci.apache.org/builders/camel-site-production/builds/28196 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'camel-site-production' triggered this build Build Source Stamp: [branch camel/website] HEAD Blamelist: Build succeeded! Sincerely, -The Buildbot
buildbot failure in on camel-site-production
The Buildbot has detected a new failure on builder camel-site-production while building . Full details are available at: https://ci.apache.org/builders/camel-site-production/builds/28194 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb-cms-slave Build Reason: The Nightly scheduler named 'camel-site-production' triggered this build Build Source Stamp: [branch camel/website] HEAD Blamelist: BUILD FAILED: failed compile Sincerely, -The Buildbot
[camel] 02/02: Extended camel-mqtt configuration test coverage with respect to Quality Of Service
This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit fe4747cc971e8fb9659356ffa8881fd96bafde3c Author: aldettinger AuthorDate: Tue Sep 18 22:15:45 2018 +0200 Extended camel-mqtt configuration test coverage with respect to Quality Of Service --- .../component/mqtt/MQTTConfigurationTest.java | 41 ++ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java index b79638e..24e0ad4 100644 --- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java +++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java @@ -25,9 +25,9 @@ public class MQTTConfigurationTest extends MQTTBaseTest { @Test public void testBasicConfiguration() throws Exception { Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true=exactlyOnce=" + TEST_TOPIC + "=" + TEST_TOPIC -+ "=" + MQTTTestSupport.getHostForMQTTEndpoint()); ++ "=" + MQTTTestSupport.getHostForMQTTEndpoint()); assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint); -MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint; +MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint; assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE); assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC); @@ -38,9 +38,9 @@ public class MQTTConfigurationTest extends MQTTBaseTest { @Test public void testMultipleSubscribeTopicsConfiguration() throws Exception { Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true=exactlyOnce=" + TEST_TOPIC + "=" + TEST_TOPICS -+ "=" + MQTTTestSupport.getHostForMQTTEndpoint()); ++ "=" + MQTTTestSupport.getHostForMQTTEndpoint()); assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint); -MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint; +MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint; assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE); assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC); @@ -50,14 +50,41 @@ public class MQTTConfigurationTest extends MQTTBaseTest { @Test public void testWildcardSubscribeTopicsConfiguration() throws Exception { -Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true=exactlyOnce=" + TEST_TOPIC + "=" + TEST_TOPICS_WITH_WILDCARDS -+ "=" + MQTTTestSupport.getHostForMQTTEndpoint()); +Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true=exactlyOnce=" + TEST_TOPIC + "=" ++ TEST_TOPICS_WITH_WILDCARDS + "=" + MQTTTestSupport.getHostForMQTTEndpoint()); assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint); -MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint; +MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint; assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE); assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC); assertEquals(mqttEndpoint.getConfiguration().getSubscribeTopicNames(), TEST_TOPICS_WITH_WILDCARDS); assertTrue(mqttEndpoint.getConfiguration().isByDefaultRetain()); } + +@Test +public void testExactlyOnceQualityOfServiceConfiguration() throws Exception { +Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=exactlyOnce"); +assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint); +MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint; + +assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE); +} + +@Test +public void testAtLeastOnceQualityOfServiceConfiguration() throws Exception { +Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=AtLeastOnce"); +assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint); +MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint; + +assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.AT_LEAST_ONCE); +} + +@Test +public void testAtMostOnceQualityOfServiceConfiguration() throws Exception { +Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=AtMostOnce"); +assertTrue("Endpoint not a
[camel] branch master updated (e94b664 -> fe4747c)
This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel.git. from e94b664 CAMEL-12816: Fixed CS in some components new 7e7cf44 Fix MQTT URI param typo. new fe4747c Extended camel-mqtt configuration test coverage with respect to Quality Of Service 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: .../camel/component/mqtt/MQTTConfiguration.java| 4 +-- .../component/mqtt/MQTTConfigurationTest.java | 41 ++ 2 files changed, 36 insertions(+), 9 deletions(-)
[camel] 01/02: Fix MQTT URI param typo.
This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 7e7cf449e4078b99bec4e8ee3cdade3aa4861f63 Author: Philippe Schaller AuthorDate: Tue Sep 18 17:40:39 2018 +0200 Fix MQTT URI param typo. --- .../main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java index eb341df..b83b4dd 100644 --- a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java +++ b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java @@ -75,7 +75,7 @@ public class MQTTConfiguration extends MQTT { String willTopic; @UriParam String willMessage; -@UriParam(enums = "AtMostOnce,AtLeastOne,ExactlyOnce", defaultValue = "AtMostOnce") +@UriParam(enums = "AtMostOnce,AtLeastOnce,ExactlyOnce", defaultValue = "AtMostOnce") QoS willQos = QoS.AT_MOST_ONCE; @UriParam QoS willRetain; @@ -112,7 +112,7 @@ public class MQTTConfiguration extends MQTT { private int sendWaitInSeconds = 5; @UriParam private boolean byDefaultRetain; -@UriParam(enums = "AtMostOnce,AtLeastOne,ExactlyOnce", defaultValue = "AtLeastOnce") +@UriParam(enums = "AtMostOnce,AtLeastOnce,ExactlyOnce", defaultValue = "AtLeastOnce") private String qualityOfService = QoS.AT_LEAST_ONCE.name(); private QoS qos = QoS.AT_LEAST_ONCE;
[camel-k] 01/03: Add sync and dev mode
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 14f411996fcfdb14ca9c5c432415e84ef317a98a Author: nferraro AuthorDate: Tue Sep 18 15:58:34 2018 +0200 Add sync and dev mode --- Gopkg.lock | 9 cmd/camel-k-operator/kamel_k_operator.go| 3 ++ cmd/kamel/kamel.go | 4 ++ pkg/client/cmd/run.go | 54 +--- cmd/kamel/kamel.go => pkg/util/sync/file.go | 48 + pkg/util/sync/file_test.go | 65 + 6 files changed, 160 insertions(+), 23 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 823b59c..a1699bb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -318,6 +318,14 @@ revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] + digest = "1:669828a2363f1ecad15fff9f008dd1d07d449fb25c9060998b15f83fec896458" + name = "github.com/radovskyb/watcher" + packages = ["."] + pruneopts = "NUT" + revision = "6145e1439b9de93806925353403f91d2abbad8a5" + version = "v1.0.2" + +[[projects]] digest = "1:0975c74a2cd70df6c2ae353c6283a25ce759dda7e1e706e5c07458baf3faca22" name = "github.com/rs/xid" packages = ["."] @@ -719,6 +727,7 @@ "github.com/operator-framework/operator-sdk/pkg/util/k8sutil", "github.com/operator-framework/operator-sdk/version", "github.com/pkg/errors", +"github.com/radovskyb/watcher", "github.com/rs/xid", "github.com/sirupsen/logrus", "github.com/spf13/cobra", diff --git a/cmd/camel-k-operator/kamel_k_operator.go b/cmd/camel-k-operator/kamel_k_operator.go index ff9e088..32ee754 100644 --- a/cmd/camel-k-operator/kamel_k_operator.go +++ b/cmd/camel-k-operator/kamel_k_operator.go @@ -19,6 +19,7 @@ package main import ( "context" + "math/rand" "runtime" "time" @@ -45,6 +46,8 @@ func watch(resource string, kind string, namespace string, resyncPeriod time.Dur } func main() { + rand.Seed(time.Now().UTC().UnixNano()) + printVersion() sdk.ExposeMetricsPort() diff --git a/cmd/kamel/kamel.go b/cmd/kamel/kamel.go index b1cba54..6c0fff2 100644 --- a/cmd/kamel/kamel.go +++ b/cmd/kamel/kamel.go @@ -21,11 +21,15 @@ import ( "fmt" "github.com/apache/camel-k/pkg/client/cmd" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "math/rand" "os" "context" + "time" ) func main() { + rand.Seed(time.Now().UTC().UnixNano()) + ctx := context.Background() rootCmd, err := cmd.NewKamelCommand(ctx) exitOnError(err) diff --git a/pkg/client/cmd/run.go b/pkg/client/cmd/run.go index 22c0aa4..335cf84 100644 --- a/pkg/client/cmd/run.go +++ b/pkg/client/cmd/run.go @@ -20,6 +20,8 @@ package cmd import ( "errors" "fmt" + "github.com/apache/camel-k/pkg/util/sync" + "github.com/sirupsen/logrus" "io/ioutil" "os" "strconv" @@ -60,6 +62,8 @@ func NewCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command { cmd.Flags().StringSliceVar(, "configmap", nil, "Add a ConfigMap") cmd.Flags().StringSliceVar(, "secret", nil, "Add a Secret") cmd.Flags().BoolVar(, "logs", false, "Print integration logs") + cmd.Flags().BoolVar(, "sync", false, "Synchronize the local source file with the cluster, republishing at each change") + cmd.Flags().BoolVar(, "dev", false, "Enable Dev mode (equivalent to \"-w --logs --sync\")") // completion support configureKnownCompletions() @@ -78,6 +82,8 @@ type runCmdOptions struct { Secrets[]string Wait bool Logs bool + Sync bool + Devbool } func (*runCmdOptions) validateArgs(cmd *cobra.Command, args []string) error { @@ -98,18 +104,29 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error { if err != nil { return err } - if o.Wait { + if o.Sync || o.Dev { + err = o.syncIntegration(args[0]) + if err != nil { + return err + } + } + if o.Wait || o.Dev { err = o.waitForIntegrationReady(integration) if err != nil { return err } } - if o.Logs { + if o.Logs || o.Dev { err = o.printLogs(integration) if err != nil { return err } } + + if o.Sync && !o.Logs && !o.Dev { + // Let's add a wait point, otherwise the script terminates + <- o.Context.Done() + } return nil } @@ -166,8 +183,33 @@ func (o *runCmdOptions) printLogs(integration *v1alpha1.Integration) error {
[camel-k] branch master updated (ec2f4bb -> 1a40993)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git. from ec2f4bb kamel install with example new 14f4119 Add sync and dev mode new 0f9503d Recompute digest when changing the context new 1a40993 Speedup deploy when building a new context The 3 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: Gopkg.lock | 9 cmd/camel-k-operator/kamel_k_operator.go | 3 ++ cmd/kamel/kamel.go | 4 ++ pkg/apis/camel/v1alpha1/types.go | 2 - pkg/apis/camel/v1alpha1/types_support.go | 10 pkg/client/cmd/run.go | 54 +++--- pkg/stub/action/context/build.go | 33 - pkg/stub/action/integration/build.go | 2 + pkg/stub/action/integration/deploy.go | 3 ++ pkg/util/{kubernetes/loader.go => sync/file.go}| 46 -- .../util/sync/file_test.go | 51 ++-- 11 files changed, 179 insertions(+), 38 deletions(-) copy pkg/util/{kubernetes/loader.go => sync/file.go} (52%) copy test/cluster_integration_test.go => pkg/util/sync/file_test.go (50%)
[camel-k] 03/03: Speedup deploy when building a new context
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 1a4099305346fc74f920cf5a865401b58e0618c3 Author: nferraro AuthorDate: Tue Sep 18 17:38:19 2018 +0200 Speedup deploy when building a new context --- pkg/apis/camel/v1alpha1/types.go | 2 -- pkg/apis/camel/v1alpha1/types_support.go | 10 ++ pkg/stub/action/context/build.go | 33 +++- pkg/stub/action/integration/deploy.go| 3 +++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/pkg/apis/camel/v1alpha1/types.go b/pkg/apis/camel/v1alpha1/types.go index fd21328..90effe8 100644 --- a/pkg/apis/camel/v1alpha1/types.go +++ b/pkg/apis/camel/v1alpha1/types.go @@ -127,8 +127,6 @@ const ( // IntegrationContextPhaseBuilding -- IntegrationContextPhaseBuilding IntegrationContextPhase = "Building" - // IntegrationContextPhaseDeploying -- - IntegrationContextPhaseDeploying IntegrationContextPhase = "Deploying" // IntegrationContextPhaseReady -- IntegrationContextPhaseReady IntegrationContextPhase = "Ready" // IntegrationContextPhaseError -- diff --git a/pkg/apis/camel/v1alpha1/types_support.go b/pkg/apis/camel/v1alpha1/types_support.go index b202aa3..39eb11d 100644 --- a/pkg/apis/camel/v1alpha1/types_support.go +++ b/pkg/apis/camel/v1alpha1/types_support.go @@ -39,6 +39,16 @@ func (spec ConfigurationSpec) String() string { // // ** +// NewIntegrationList -- +func NewIntegrationList() IntegrationList { + return IntegrationList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: SchemeGroupVersion.String(), + Kind: IntegrationKind, + }, + } +} + // NewIntegrationContext -- func NewIntegrationContext(namespace string, name string) IntegrationContext { return IntegrationContext{ diff --git a/pkg/stub/action/context/build.go b/pkg/stub/action/context/build.go index ca9b44b..249cf71 100644 --- a/pkg/stub/action/context/build.go +++ b/pkg/stub/action/context/build.go @@ -19,6 +19,7 @@ package action import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/operator-framework/operator-sdk/pkg/sdk" "github.com/sirupsen/logrus" @@ -29,6 +30,7 @@ import ( "github.com/apache/camel-k/pkg/build" ) +// NewIntegrationContextBuildAction creates a new build handling action for the context func NewIntegrationContextBuildAction(ctx context.Context, namespace string) IntegrationContextAction { return { buildManager: build.NewManager(ctx, namespace), @@ -68,8 +70,37 @@ func (action *integrationContextBuildAction) Handle(context *v1alpha1.Integratio target := context.DeepCopy() target.Status.Image = buildResult.Image target.Status.Phase = v1alpha1.IntegrationContextPhaseReady - return sdk.Update(target) + if err := sdk.Update(target); err != nil { + return err + } + if err := action.informIntegrations(target); err != nil { + return err + } } return nil } + +// informIntegrations triggers the processing of all integrations waiting for this context to be built +func (action *integrationContextBuildAction) informIntegrations(context *v1alpha1.IntegrationContext) error { + list := v1alpha1.NewIntegrationList() + err := sdk.List(context.Namespace, , sdk.WithListOptions({})) + if err != nil { + return err + } + for _, integration := range list.Items { + if integration.Spec.Context != context.Name { + continue + } + + if integration.Annotations == nil { + integration.Annotations = make(map[string]string) + } + integration.Annotations["camel.apache.org/context.digest"] = context.Status.Digest + err = sdk.Update() + if err != nil { + return err + } + } + return nil +} diff --git a/pkg/stub/action/integration/deploy.go b/pkg/stub/action/integration/deploy.go index b8adb43..99545f6 100644 --- a/pkg/stub/action/integration/deploy.go +++ b/pkg/stub/action/integration/deploy.go @@ -151,6 +151,9 @@ func getDeploymentFor(ctx *v1alpha1.IntegrationContext, integration *v1alpha1.In // has been changed environment["CAMEL_K_DIGEST"] = integration.Status.Digest + // optimizations + environment["AB_JOLOKIA_OFF"] = "true" + labels := map[string]string{ "camel.apache.org/integration": integration.Name, }
[camel-k] 02/03: Recompute digest when changing the context
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 0f9503dc59ea7d44c00db198afec775e48be9829 Author: nferraro AuthorDate: Tue Sep 18 16:50:01 2018 +0200 Recompute digest when changing the context --- pkg/stub/action/integration/build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/stub/action/integration/build.go b/pkg/stub/action/integration/build.go index b99ab4e..5978365 100644 --- a/pkg/stub/action/integration/build.go +++ b/pkg/stub/action/integration/build.go @@ -19,6 +19,7 @@ package action import ( "fmt" + "github.com/apache/camel-k/pkg/util/digest" "github.com/rs/xid" @@ -74,6 +75,7 @@ func (action *buildAction) Handle(integration *v1alpha1.Integration) error { target.Status.Image = ctx.Status.Image target.Spec.Context = ctx.Name target.Status.Phase = v1alpha1.IntegrationPhaseDeploying + target.Status.Digest = digest.ComputeForIntegration(target) return sdk.Update(target) }
[camel-k] branch master updated: kamel install with example
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 The following commit(s) were added to refs/heads/master by this push: new ec2f4bb kamel install with example ec2f4bb is described below commit ec2f4bb8f739720a3eead7f0c68b68e0ab05c470 Author: Dmitry Volodin AuthorDate: Mon Sep 17 16:23:13 2018 +0300 kamel install with example --- deploy/cr-example.yaml| 22 ++ deploy/cr.yaml| 22 -- deploy/resources.go | 35 +-- pkg/client/cmd/install.go | 9 + pkg/install/operator.go | 7 +++ 5 files changed, 55 insertions(+), 40 deletions(-) diff --git a/deploy/cr-example.yaml b/deploy/cr-example.yaml new file mode 100644 index 000..c2851c7 --- /dev/null +++ b/deploy/cr-example.yaml @@ -0,0 +1,22 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Integration +metadata: + name: example +spec: + dependencies: +- camel:groovy + source: +content: |- + // This is Camel K Groovy example route + + rnd = new Random() + + from('timer:groovy?period=1s') + .routeId('groovy') + .setBody() + .constant('Hello Camel K!') + .process { + it.in.headers['RandomValue'] = rnd.nextInt() + } + .to('log:info?showHeaders=true') +name: routes.groovy \ No newline at end of file diff --git a/deploy/cr.yaml b/deploy/cr.yaml deleted file mode 100644 index ae0ee37..000 --- a/deploy/cr.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: "camel.apache.org/v1alpha1" -kind: "Integration" -metadata: - name: "example" -spec: - replicas: 1 - source: -code: |- - package kamel; - - import org.apache.camel.builder.RouteBuilder; - - public class Routes extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("timer:tick") -.setBody(constant("Hello World!!!")) -.to("log:info"); - } - - } diff --git a/deploy/resources.go b/deploy/resources.go index ed871fd..b3492c7 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -66,31 +66,30 @@ spec: version: v1alpha1 ` - Resources["cr.yaml"] = + Resources["cr-example.yaml"] = ` -apiVersion: "camel.apache.org/v1alpha1" -kind: "Integration" +apiVersion: camel.apache.org/v1alpha1 +kind: Integration metadata: - name: "example" + name: example spec: - replicas: 1 + dependencies: +- camel:groovy source: -code: |- - package kamel; +content: |- + // This is Camel K Groovy example route - import org.apache.camel.builder.RouteBuilder; + rnd = new Random() - public class Routes extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("timer:tick") -.setBody(constant("Hello World!!!")) -.to("log:info"); + from('timer:groovy?period=1s') + .routeId('groovy') + .setBody() + .constant('Hello Camel K!') + .process { + it.in.headers['RandomValue'] = rnd.nextInt() } - - } - + .to('log:info?showHeaders=true') +name: routes.groovy ` Resources["operator-deployment.yaml"] = ` diff --git a/pkg/client/cmd/install.go b/pkg/client/cmd/install.go index d71c3c5..cd84fbd 100644 --- a/pkg/client/cmd/install.go +++ b/pkg/client/cmd/install.go @@ -41,6 +41,7 @@ func NewCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command { } cmd.Flags().BoolVar(, "cluster-setup", false, "Execute cluster-wide operations only (may require admin rights)") + cmd.Flags().BoolVar(, "example", false, "Install example integration") cmd.ParseFlags(os.Args) return @@ -49,6 +50,7 @@ func NewCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command { type installCmdOptions struct { *RootCmdOptions clusterSetupOnly bool + exampleSetup bool } func (o *installCmdOptions) install(cmd *cobra.Command, args []string) error { @@ -73,6 +75,13 @@ func (o *installCmdOptions) install(cmd *cobra.Command, args []string) error { return err } + if o.exampleSetup { + err = install.Example(namespace) + if err != nil { + return err + } + } + fmt.Println("Camel K installed in namespace", namespace) } diff --git a/pkg/install/operator.go b/pkg/install/operator.go index 528424a..58aed65 100644 --- a/pkg/install/operator.go +++ b/pkg/install/operator.go @@ -45,6 +45,13 @@ func PlatformContexts(namespace string) error { ) } +// Example -- +func
svn commit: r29483 - in /release/camel/apache-camel/2.21.2: apache-camel-2.21.2-src.zip.sha512 apache-camel-2.21.2.pom.sha512 apache-camel-2.21.2.tar.gz.sha512 apache-camel-2.21.2.zip.sha512
Author: zregvart Date: Tue Sep 18 14:11:23 2018 New Revision: 29483 Log: Fixed checksums for Apache Camel 2.21.2 (added .sha512 files) Added: release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.sha512 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.sha512 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.sha512 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.sha512 Added: release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.sha512 == --- release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.sha512 (added) +++ release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.sha512 Tue Sep 18 14:11:23 2018 @@ -0,0 +1 @@ +3d384df847a749933a3601cac3139c4da823503dccbac969e5a7201c274262c97608aedd4780e31f093225546865de81aa13b8f3bbf6ccaec888306457cd25c8 apache-camel-2.21.2-src.zip Added: release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.sha512 == --- release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.sha512 (added) +++ release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.sha512 Tue Sep 18 14:11:23 2018 @@ -0,0 +1 @@ +4a252c9e9770d3545dc8418a40b8b9102eafe5930ac0f4d6c5c63caeb289eec1fb284d0974a9825e639f2cb2ce689f43e9d6cc5b71ae0256ea8eb38c2dfcb2e5 apache-camel-2.21.2.pom Added: release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.sha512 == --- release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.sha512 (added) +++ release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.sha512 Tue Sep 18 14:11:23 2018 @@ -0,0 +1 @@ +329d5f6d2659254c7ea68cce2f494081bca2af81d3c66e251f7427339b1d804e37ca51d20a2cc029e0f1d920432287de67c1f86f12dca6ed0ead694d42e7f010 apache-camel-2.21.2.tar.gz Added: release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.sha512 == --- release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.sha512 (added) +++ release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.sha512 Tue Sep 18 14:11:23 2018 @@ -0,0 +1 @@ +6454fa0bc7d998b05469f6b01027ece426483ac672c66b20cae18ce2a57c1766f754f6add4e3e862d59f5f4cb0f849f36e5e3c0672cba2064b11c1ab77a81366 apache-camel-2.21.2.zip
svn commit: r29482 - in /release/camel/apache-camel: 2.21.2/ 2.22.1/
Author: zregvart Date: Tue Sep 18 14:09:31 2018 New Revision: 29482 Log: Removing redundant .asc.asc files Removed: release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.asc.asc release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.asc.asc release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.asc.asc release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.asc.asc release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.asc.asc release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.asc.asc release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.asc.asc release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.asc.asc
[camel] branch camel-2.22.x updated: CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch camel-2.22.x in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/camel-2.22.x by this push: new 435da6f CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing 435da6f is described below commit 435da6f8e174be57f001b6e33b61498c9da4fceb Author: Andrea Cosentino AuthorDate: Tue Sep 18 15:16:07 2018 +0200 CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing --- .../apache/camel/component/aws/sqs/SqsEndpoint.java | 2 +- .../aws/sqs/SqsComponentConfigurationTest.java | 20 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java index 4506734..1182f12 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java @@ -129,7 +129,7 @@ public class SqsEndpoint extends ScheduledPollEndpoint implements HeaderFilterSt if (configuration.getRegion() != null && configuration.getQueueOwnerAWSAccountId() != null) { String host = configuration.getAmazonAWSHost(); host = FileUtil.stripTrailingSeparator(host); -queueUrl = "https://sqs.; + configuration.getRegion() + "." + host + "/" +queueUrl = "https://sqs.; + Regions.valueOf(configuration.getRegion()).getName() + "." + host + "/" + configuration.getQueueOwnerAWSAccountId() + "/" + configuration.getQueueName(); } else if (configuration.getQueueOwnerAWSAccountId() != null) { GetQueueUrlRequest getQueueUrlRequest = new GetQueueUrlRequest(); diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java index 2699482..6b54208 100644 --- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java +++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java @@ -68,6 +68,26 @@ public class SqsComponentConfigurationTest extends CamelTestSupport { } @Test +public void createEndpointWithOnlyAccessKeyAndSecretKeyAndRegion() throws Exception { +SqsComponent component = new SqsComponent(context); +SqsEndpoint endpoint = (SqsEndpoint) component.createEndpoint("aws-sqs://MyQueue?accessKey=xxx=yyy=US_WEST_1"); + +assertEquals("MyQueue", endpoint.getConfiguration().getQueueName()); +assertEquals("xxx", endpoint.getConfiguration().getAccessKey()); +assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); +assertEquals("US_WEST_1", endpoint.getConfiguration().getRegion()); +assertNull(endpoint.getConfiguration().getAmazonSQSClient()); +assertNull(endpoint.getConfiguration().getAttributeNames()); +assertNull(endpoint.getConfiguration().getMessageAttributeNames()); +assertNull(endpoint.getConfiguration().getDefaultVisibilityTimeout()); +assertNull(endpoint.getConfiguration().getVisibilityTimeout()); +assertNull(endpoint.getConfiguration().getMaximumMessageSize()); +assertNull(endpoint.getConfiguration().getMessageRetentionPeriod()); +assertNull(endpoint.getConfiguration().getPolicy()); +assertNull(endpoint.getConfiguration().getRedrivePolicy()); +} + +@Test public void createEndpointWithMinimalArnConfiguration() throws Exception { AmazonSQSClientMock mock = new AmazonSQSClientMock();
[camel] branch master updated: CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new 97f2cd0 CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing 97f2cd0 is described below commit 97f2cd00e2df66e21a63f5f3dbc0d496b174ef8a Author: Andrea Cosentino AuthorDate: Tue Sep 18 15:16:07 2018 +0200 CAMEL-12820 - SQS: Malformed queue URL due to bad region parsing --- .../apache/camel/component/aws/sqs/SqsEndpoint.java | 2 +- .../aws/sqs/SqsComponentConfigurationTest.java | 20 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java index 4506734..1182f12 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java @@ -129,7 +129,7 @@ public class SqsEndpoint extends ScheduledPollEndpoint implements HeaderFilterSt if (configuration.getRegion() != null && configuration.getQueueOwnerAWSAccountId() != null) { String host = configuration.getAmazonAWSHost(); host = FileUtil.stripTrailingSeparator(host); -queueUrl = "https://sqs.; + configuration.getRegion() + "." + host + "/" +queueUrl = "https://sqs.; + Regions.valueOf(configuration.getRegion()).getName() + "." + host + "/" + configuration.getQueueOwnerAWSAccountId() + "/" + configuration.getQueueName(); } else if (configuration.getQueueOwnerAWSAccountId() != null) { GetQueueUrlRequest getQueueUrlRequest = new GetQueueUrlRequest(); diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java index 2699482..6b54208 100644 --- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java +++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java @@ -68,6 +68,26 @@ public class SqsComponentConfigurationTest extends CamelTestSupport { } @Test +public void createEndpointWithOnlyAccessKeyAndSecretKeyAndRegion() throws Exception { +SqsComponent component = new SqsComponent(context); +SqsEndpoint endpoint = (SqsEndpoint) component.createEndpoint("aws-sqs://MyQueue?accessKey=xxx=yyy=US_WEST_1"); + +assertEquals("MyQueue", endpoint.getConfiguration().getQueueName()); +assertEquals("xxx", endpoint.getConfiguration().getAccessKey()); +assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); +assertEquals("US_WEST_1", endpoint.getConfiguration().getRegion()); +assertNull(endpoint.getConfiguration().getAmazonSQSClient()); +assertNull(endpoint.getConfiguration().getAttributeNames()); +assertNull(endpoint.getConfiguration().getMessageAttributeNames()); +assertNull(endpoint.getConfiguration().getDefaultVisibilityTimeout()); +assertNull(endpoint.getConfiguration().getVisibilityTimeout()); +assertNull(endpoint.getConfiguration().getMaximumMessageSize()); +assertNull(endpoint.getConfiguration().getMessageRetentionPeriod()); +assertNull(endpoint.getConfiguration().getPolicy()); +assertNull(endpoint.getConfiguration().getRedrivePolicy()); +} + +@Test public void createEndpointWithMinimalArnConfiguration() throws Exception { AmazonSQSClientMock mock = new AmazonSQSClientMock();
svn commit: r29479 - /release/camel/apache-camel/2.21.2/
Author: zregvart Date: Tue Sep 18 12:47:46 2018 New Revision: 29479 Log: Fixed checksums for Apache Camel 2.21.2 Removed: release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.md5 release/camel/apache-camel/2.21.2/apache-camel-2.21.2-src.zip.sha1 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.md5 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.pom.sha1 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.md5 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.tar.gz.sha1 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.md5 release/camel/apache-camel/2.21.2/apache-camel-2.21.2.zip.sha1
svn commit: r29478 - /release/camel/apache-camel/2.22.1/
Author: zregvart Date: Tue Sep 18 12:10:08 2018 New Revision: 29478 Log: Fixed checksums for Apache Camel 2.22.1 Added: release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.sha512 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.sha512 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.sha512 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.sha512 Removed: release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.md5 release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.sha1 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.md5 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.sha1 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.md5 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.sha1 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.md5 release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.sha1 Added: release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.sha512 == --- release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.sha512 (added) +++ release/camel/apache-camel/2.22.1/apache-camel-2.22.1-src.zip.sha512 Tue Sep 18 12:10:08 2018 @@ -0,0 +1 @@ +20ef94686dcd18db2d83a67fc8850c455a092f56d56b8db21417df14e5d422356dc4a51b103f5ecaf6448b9c76c7b5f2fd832bd8b6256c809cec4aa687a1cc61 apache-camel-2.22.1-src.zip Added: release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.sha512 == --- release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.sha512 (added) +++ release/camel/apache-camel/2.22.1/apache-camel-2.22.1.pom.sha512 Tue Sep 18 12:10:08 2018 @@ -0,0 +1 @@ +69eb30446640b3eacb2fb67f2c559fee7265967b892fa9049f3c135538aaaeca68e81392a88f3ebbf095a4950fd2eede1cbc153dc07358ce491cdf02dd3a0b98 apache-camel-2.22.1.pom Added: release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.sha512 == --- release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.sha512 (added) +++ release/camel/apache-camel/2.22.1/apache-camel-2.22.1.tar.gz.sha512 Tue Sep 18 12:10:08 2018 @@ -0,0 +1 @@ +dade9021fff1e18e86ad4bfbd8f016f84027cc36342a500074f5fd9caec20f7094ac402e69400fb6818429f179226087d17aa42e54cd07913c4bb07d3494 apache-camel-2.22.1.tar.gz Added: release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.sha512 == --- release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.sha512 (added) +++ release/camel/apache-camel/2.22.1/apache-camel-2.22.1.zip.sha512 Tue Sep 18 12:10:08 2018 @@ -0,0 +1 @@ +8370d37ef5db46e2ecc0f292999d0fc6cad92ea851a38a3281866cea6214a5568406df15b2d43522be58cea5e27a3d98455cb57fac7611206a4eba169601493f apache-camel-2.22.1.zip
[camel] branch master updated: Upgrade Apache POM to version 21
This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new d22aeb5 Upgrade Apache POM to version 21 d22aeb5 is described below commit d22aeb5f731d6e18ca30cf2228eb3bf80a0ffbd7 Author: Zoran Regvart AuthorDate: Tue Sep 18 14:00:13 2018 +0200 Upgrade Apache POM to version 21 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7dde856..0f39917 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.apache apache -20 +21 4.0.0
[camel-k] branch master updated: chore(cobra): add autocompletion for configmap and secrets
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 The following commit(s) were added to refs/heads/master by this push: new cced8e2 chore(cobra): add autocompletion for configmap and secrets cced8e2 is described below commit cced8e2d94edb21a6c833149cdb00dab2bea0383 Author: lburgazzoli AuthorDate: Tue Sep 18 13:06:03 2018 +0200 chore(cobra): add autocompletion for configmap and secrets --- pkg/client/cmd/completion.go | 48 ++--- pkg/client/cmd/completion_bash.go | 107 + .../cmd/{completion.go => completion_zsh.go} | 43 +++-- pkg/client/cmd/context_create.go | 3 + pkg/client/cmd/root.go | 17 +++- pkg/client/cmd/run.go | 3 + 6 files changed, 149 insertions(+), 72 deletions(-) diff --git a/pkg/client/cmd/completion.go b/pkg/client/cmd/completion.go index e172df0..e26444d 100644 --- a/pkg/client/cmd/completion.go +++ b/pkg/client/cmd/completion.go @@ -18,54 +18,22 @@ limitations under the License. package cmd import ( - "os" - "github.com/spf13/cobra" ) -const bashCompletionCmdLongDescription = ` -To load completion run - -. <(kamel completion) - -To configure your bash shell to load completions for each session add to your bashrc - -# ~/.bashrc or ~/.profile -. <(kamel completion) -` - -const zshCompletionCmdLongDescription = ` -To configure your zsh shell to load completions for each session add to your zshrc - -if [ $commands[kamel] ]; then - source <(kamel completion zsh) -fi -` - -// NewCmdCompletion -- -func NewCmdCompletion(root *cobra.Command) *cobra.Command { +func newCmdCompletion(root *cobra.Command) *cobra.Command { completion := cobra.Command{ Use: "completion", Short: "Generates completion scripts", } - completion.AddCommand({ - Use: "bash", - Short: "Generates bash completion scripts", - Long: bashCompletionCmdLongDescription, - Run: func(cmd *cobra.Command, args []string) { - root.GenBashCompletion(os.Stdout) - }, - }) - - completion.AddCommand({ - Use: "zsh", - Short: "Generates zsh completion scripts", - Long: zshCompletionCmdLongDescription, - Run: func(cmd *cobra.Command, args []string) { - root.GenZshCompletion(os.Stdout) - }, - }) + completion.AddCommand(newCmdCompletionBash(root)) + completion.AddCommand(newCmdCompletionZsh(root)) return } + +func configureKnownCompletions(command *cobra.Command) { + configureKnownBashCompletions(command) + configureKnownZshCompletions(command) +} diff --git a/pkg/client/cmd/completion_bash.go b/pkg/client/cmd/completion_bash.go new file mode 100644 index 000..34aad56 --- /dev/null +++ b/pkg/client/cmd/completion_bash.go @@ -0,0 +1,107 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cmd + +import ( + "os" + + "github.com/spf13/cobra" +) + +// ** +// +// +// +// ** + +const bashCompletionCmdLongDescription = ` +To load completion run + +. <(kamel completion bash) + +To configure your bash shell to load completions for each session add to your bashrc + +# ~/.bashrc or ~/.profile +. <(kamel completion bash) +` + +const bashCompletionFunction = ` +__kamel_dependency_type() { +COMPREPLY=( $( compgen -W "camel: mvn: file:" -- "$cur") ) + compopt -o nospace +} + +__kamel_kubectl_get_configmap() { +local template +local kubectl_out + +template="{{ range .items }}{{ .metadata.name }} {{ end }}" + +if kubectl_out=$(kubectl get -o template --template="${template}" configmap 2>/dev/null); then +COMPREPLY=( $( compgen -W "${kubectl_out}" -- "$cur" ) ) +fi +} + +__kamel_kubectl_get_secret() { +local template +local kubectl_out + +template="{{ range .items }}{{ .metadata.name }} {{ end }}" + +if
[camel-k] branch master updated (70a6c00 -> 41d2e3d)
This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git. from 70a6c00 Merge pull request #88 from nicolaferraro/master add 41d2e3d chore(cobra): fix code name detection No new revisions were added by this update. Summary of changes: pkg/client/cmd/run.go | 9 + 1 file changed, 5 insertions(+), 4 deletions(-)
[camel-k] branch master updated (44f1e40 -> 70a6c00)
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git. from 44f1e40 Pod log implementation add 7444a81 Simplify install and update readme add 70a6c00 Merge pull request #88 from nicolaferraro/master No new revisions were added by this update. Summary of changes: README.md | 11 +-- build/Makefile | 1 + build/install_minishift.sh | 34 +- cmd/kamel/kamel.go | 2 +- deploy/operator-deployment.yaml | 2 ++ deploy/resources.go | 2 ++ pkg/client/cmd/install.go | 9 - 7 files changed, 36 insertions(+), 25 deletions(-)
[camel-k] branch master updated: Pod log implementation
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 44f1e40 Pod log implementation 44f1e40 is described below commit 44f1e40dcf038ada075f57ef073c3f113d7adbcb Author: nferraro AuthorDate: Tue Sep 18 01:32:08 2018 +0200 Pod log implementation --- Gopkg.lock | 1 + pkg/client/cmd/run.go | 25 + pkg/util/log/annotation_scraper.go | 166 +++ pkg/util/log/pod_scraper.go| 175 + test/build_manager_integration_test.go | 8 +- test/local_builder_integration_test.go | 14 +-- test/log_scrape_integration_test.go| 106 test/testing_env.go| 118 +- 8 files changed, 599 insertions(+), 14 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index bc54a02..823b59c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -736,6 +736,7 @@ "k8s.io/apimachinery/pkg/runtime/serializer/json", "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "k8s.io/apimachinery/pkg/util/yaml", +"k8s.io/apimachinery/pkg/watch", "k8s.io/client-go/plugin/pkg/client/auth/gcp", "k8s.io/client-go/rest", "k8s.io/client-go/tools/clientcmd", diff --git a/pkg/client/cmd/run.go b/pkg/client/cmd/run.go index c4df815..171ed1d 100644 --- a/pkg/client/cmd/run.go +++ b/pkg/client/cmd/run.go @@ -32,6 +32,8 @@ import ( "github.com/spf13/cobra" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/apache/camel-k/pkg/util/log" + "io" ) // NewCmdRun -- @@ -56,6 +58,7 @@ func NewCmdRun(rootCmdOptions *RootCmdOptions) *cobra.Command { cmd.Flags().StringSliceVarP(, "property", "p", nil, "Add a camel property") cmd.Flags().StringSliceVar(, "configmap", nil, "Add a ConfigMap") cmd.Flags().StringSliceVar(, "secret", nil, "Add a Secret") + cmd.Flags().BoolVar(, "logs", false, "Print integration logs") return } @@ -70,6 +73,7 @@ type runCmdOptions struct { ConfigMaps []string Secrets[]string Wait bool + Logs bool } func (*runCmdOptions) validateArgs(cmd *cobra.Command, args []string) error { @@ -96,6 +100,12 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error { return err } } + if o.Logs { + err = o.printLogs(integration) + if err != nil { + return err + } + } return nil } @@ -137,6 +147,21 @@ watcher: return nil } +func (o *runCmdOptions) printLogs(integration *v1alpha1.Integration) error { + scraper := log.NewSelectorScraper(integration.Namespace, "camel.apache.org/integration=" + integration.Name) + reader := scraper.Start(o.Context) + for { + str, err := reader.ReadString('\n') + if err == io.EOF || o.Context.Err() != nil { + break + } else if err != nil { + return err + } + fmt.Print(str) + } + return nil +} + func (o *runCmdOptions) createIntegration(cmd *cobra.Command, args []string) (*v1alpha1.Integration, error) { code, err := o.loadCode(args[0]) if err != nil { diff --git a/pkg/util/log/annotation_scraper.go b/pkg/util/log/annotation_scraper.go new file mode 100644 index 000..2e47b5e --- /dev/null +++ b/pkg/util/log/annotation_scraper.go @@ -0,0 +1,166 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package log + +import ( + "bufio" + "io" + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/operator-framework/operator-sdk/pkg/sdk" + "k8s.io/api/core/v1" + "sync" + "sync/atomic" + "strconv" + "github.com/sirupsen/logrus" + "time" +) + +// SelectorScraper scrapes all pods with a given
[camel] branch master updated: Upgrade Mongodb Java Driver to version 3.8.1
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new d1ba18f Upgrade Mongodb Java Driver to version 3.8.1 d1ba18f is described below commit d1ba18f9272b86cd7778b1355dfefe77b6645fcd Author: Andrea Cosentino AuthorDate: Tue Sep 18 09:38:23 2018 +0200 Upgrade Mongodb Java Driver to version 3.8.1 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index a4831e2..31ffcad 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -504,7 +504,7 @@ 1.9 0.0.17 2.21.0 -3.8.0 +3.8.1 1.5.0 1.14 2013.6.1
[camel] 02/04: Upgrade Chronicle Threads to version 1.16.4
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 8ebd9f851f4cccd2dd6f4cae4bc64a955f4dcbe7 Author: Andrea Cosentino AuthorDate: Tue Sep 18 09:18:27 2018 +0200 Upgrade Chronicle Threads to version 1.16.4 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 7944f5e..256d084 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -125,7 +125,7 @@ 2.4.17 1.16.5 4.16.5 -1.16.3 +1.16.4 1.16.18 3.3.1 3.3.1_1
[camel] 01/04: Upgrade Chronicle Core to version 1.16.26
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 6eda5e061049fa4c6fcda840f58efe36060620b1 Author: Andrea Cosentino AuthorDate: Tue Sep 18 09:17:54 2018 +0200 Upgrade Chronicle Core to version 1.16.26 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index ad11768..7944f5e 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -120,7 +120,7 @@ 3.2.6_1 3.2.6 1.16.25 -1.16.25 +1.16.26 1.13.27 2.4.17 1.16.5
[camel] 03/04: Upgrade Chronicle Bytes to version 1.16.26
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 241c645f7cea313e3a7f96d2ae817b4c7b5ed7ad Author: Andrea Cosentino AuthorDate: Tue Sep 18 09:18:54 2018 +0200 Upgrade Chronicle Bytes to version 1.16.26 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 256d084..8a7bbfa 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -119,7 +119,7 @@ 1.2 3.2.6_1 3.2.6 -1.16.25 +1.16.26 1.16.26 1.13.27 2.4.17
[camel] branch master updated (d54f4b3 -> c815b3e)
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/camel.git. from d54f4b3 Regen new 6eda5e0 Upgrade Chronicle Core to version 1.16.26 new 8ebd9f8 Upgrade Chronicle Threads to version 1.16.4 new 241c645 Upgrade Chronicle Bytes to version 1.16.26 new c815b3e Upgrade Chronicle Wire to version 1.16.19 The 4 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: parent/pom.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-)
[camel] 04/04: Upgrade Chronicle Wire to version 1.16.19
This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit c815b3e37b2912bdcce711bf129ae9b821d2eedf Author: Andrea Cosentino AuthorDate: Tue Sep 18 09:19:22 2018 +0200 Upgrade Chronicle Wire to version 1.16.19 --- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parent/pom.xml b/parent/pom.xml index 8a7bbfa..a4831e2 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -126,7 +126,7 @@ 1.16.5 4.16.5 1.16.4 -1.16.18 +1.16.19 3.3.1 3.3.1_1 1.1.0
[camel] branch master updated: Regen
This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new d54f4b3 Regen d54f4b3 is described below commit d54f4b380d7bc572c94fb79df24d9aa16f937fdf Author: Claus Ibsen AuthorDate: Tue Sep 18 09:13:06 2018 +0200 Regen --- .../components-starter/camel-spring-ws-starter/pom.xml| 8 .../spring-boot-dm/camel-spring-boot-dependencies/pom.xml | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/platforms/spring-boot/components-starter/camel-spring-ws-starter/pom.xml b/platforms/spring-boot/components-starter/camel-spring-ws-starter/pom.xml index aebc0c7..02c48d6 100644 --- a/platforms/spring-boot/components-starter/camel-spring-ws-starter/pom.xml +++ b/platforms/spring-boot/components-starter/camel-spring-ws-starter/pom.xml @@ -38,14 +38,6 @@ org.apache.camel camel-spring-ws ${project.version} - - - - commons-logging - commons-logging - - - diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml index 88a1a7c..0246ebb 100644 --- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml +++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml @@ -3459,7 +3459,7 @@ org.knowm.xchange xchange-core -4.3.9 +4.3.10 org.mozilla