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 2021/04/29 13:12:42 UTC

[camel-k] 28/30: chore(trait): polishing PR

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

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

commit 82df277aa82431a0ba26188c635ce65ce4567ff2
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Tue Apr 27 17:19:00 2021 +0200

    chore(trait): polishing PR
---
 .../camel-k-dev/1.4.0/camel.apache.org_integrations.yaml  | 15 ---------------
 deploy/traits.yaml                                        |  2 +-
 docs/modules/traits/pages/error-handler.adoc              |  2 +-
 .../kamelets/error-handler/error-handler.kamelet.yaml     |  3 +--
 .../error-handler/incremental-id-source.kamelet.yaml      |  2 +-
 pkg/apis/camel/v1/integration_types_support.go            |  2 +-
 pkg/trait/error_handler.go                                |  2 +-
 7 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_integrations.yaml b/deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_integrations.yaml
index 0b1b88a..96e26b9 100644
--- a/deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_integrations.yaml
+++ b/deploy/olm-catalog/camel-k-dev/1.4.0/camel.apache.org_integrations.yaml
@@ -88,21 +88,6 @@ spec:
                 items:
                   type: string
                 type: array
-              errorHandler:
-                description: ErrorHandlerSpec respresents an integration error handler
-                  to be used as default at runtime
-                properties:
-                  parameters:
-                    description: ErrorHandlerParameters is an unstructured object
-                      representing the configuration parameters available for an error
-                      handler
-                    type: object
-                    x-kubernetes-preserve-unknown-fields: true
-                  type:
-                    type: string
-                  uri:
-                    type: string
-                type: object
               flows:
                 items:
                   description: Flow is an unstructured object representing a Camel
diff --git a/deploy/traits.yaml b/deploy/traits.yaml
index 22cc617..b2c3af3 100755
--- a/deploy/traits.yaml
+++ b/deploy/traits.yaml
@@ -284,7 +284,7 @@ traits:
     type: bool
     description: Can be used to enable or disable a trait. All traits share this common
       property.
-  - name: ',omitempty'
+  - name: error-handler-ref
     type: string
     description: The error handler ref name found in application properties
 - name: gc
diff --git a/docs/modules/traits/pages/error-handler.adoc b/docs/modules/traits/pages/error-handler.adoc
index 149eaee..978e76f 100755
--- a/docs/modules/traits/pages/error-handler.adoc
+++ b/docs/modules/traits/pages/error-handler.adoc
@@ -27,7 +27,7 @@ The following configuration options are available:
 | bool
 | Can be used to enable or disable a trait. All traits share this common property.
 
-| error-handler.,omitempty
+| error-handler.error-handler-ref
 | string
 | The error handler ref name found in application properties
 
diff --git a/examples/kamelets/error-handler/error-handler.kamelet.yaml b/examples/kamelets/error-handler/error-handler.kamelet.yaml
index 9ace959..a5aa060 100644
--- a/examples/kamelets/error-handler/error-handler.kamelet.yaml
+++ b/examples/kamelets/error-handler/error-handler.kamelet.yaml
@@ -22,7 +22,7 @@ metadata:
 spec:
   definition:
     title: "Error Log Sink"
-    description: "Consume events from a channel"
+    description: "Error logger channel"
     required:
       - message
     properties:
@@ -35,7 +35,6 @@ spec:
     from:
       uri: kamelet:source
       steps:
-#      - to: my-dlc
       - set-body:
           constant: "{{message}}"
       - to: "log:error-sink"  
diff --git a/examples/kamelets/error-handler/incremental-id-source.kamelet.yaml b/examples/kamelets/error-handler/incremental-id-source.kamelet.yaml
index 5e3181b..ee475da 100644
--- a/examples/kamelets/error-handler/incremental-id-source.kamelet.yaml
+++ b/examples/kamelets/error-handler/incremental-id-source.kamelet.yaml
@@ -24,7 +24,7 @@ metadata:
 spec:
   definition:
     title: "Incremental ID Source"
-    description: "Produces periodic events with an incremental ID"
+    description: "Produces periodic events with an incremental ID and fails when the ID contains any 0 character"
     properties:
       period:
         title: Period
diff --git a/pkg/apis/camel/v1/integration_types_support.go b/pkg/apis/camel/v1/integration_types_support.go
index 6efdc24..f7e505e 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -136,7 +136,7 @@ func (in *IntegrationSpec) GetConfigurationProperty(property string) string {
 	for _, confSpec := range in.Configuration {
 		if confSpec.Type == "property" && strings.HasPrefix(confSpec.Value, property) {
 			splitConf := strings.Split(confSpec.Value, "=")
-			if len(splitConf) > 0 {
+			if len(splitConf) > 1 {
 				return splitConf[1]
 			}
 		}
diff --git a/pkg/trait/error_handler.go b/pkg/trait/error_handler.go
index dd6e218..a72a94a 100644
--- a/pkg/trait/error_handler.go
+++ b/pkg/trait/error_handler.go
@@ -29,7 +29,7 @@ import (
 type errorHandlerTrait struct {
 	BaseTrait `property:",squash"`
 	// The error handler ref name found in application properties
-	ErrorHandlerRef string `property:",omitempty"`
+	ErrorHandlerRef string `property:"error-handler-ref" json:"error-handler-ref,omitempty"`
 }
 
 func newErrorHandlerTrait() Trait {