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 0aae94245ba436fb6a8cda3765bb7bbfa435fb0f Author: Pasquale Congiusti <[email protected]> AuthorDate: Wed Apr 21 16:12:32 2021 +0200 doc(trait): error-handler generated doc --- deploy/traits.yaml | 9 ++++++++ docs/modules/ROOT/nav.adoc | 1 + docs/modules/traits/pages/error-handler.adoc | 32 ++++++++++++++++++++++++++++ pkg/trait/error_handler.go | 5 ++--- pkg/trait/trait_test.go | 2 +- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 75522d2..0c567dd 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -271,6 +271,15 @@ traits: type: bool description: Enables injection of `NAMESPACE` and `POD_NAME` environment variables (default `true`) +- name: error-handler + platform: true + profiles: + - Kubernetes + - Knative + - OpenShift + description: The error-handler is a platform trait used to inject Error Handler + source into the integration runtime. + properties: [] - name: gc platform: false profiles: diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index ea9558a..e3d322e 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -41,6 +41,7 @@ ** xref:traits:deployer.adoc[Deployer] ** xref:traits:deployment.adoc[Deployment] ** xref:traits:environment.adoc[Environment] +** xref:traits:error-handler.adoc[Error Handler] ** xref:traits:gc.adoc[Gc] ** xref:traits:ingress.adoc[Ingress] ** xref:traits:istio.adoc[Istio] diff --git a/docs/modules/traits/pages/error-handler.adoc b/docs/modules/traits/pages/error-handler.adoc new file mode 100755 index 0000000..0c38c7d --- /dev/null +++ b/docs/modules/traits/pages/error-handler.adoc @@ -0,0 +1,32 @@ += Error Handler Trait + +// Start of autogenerated code - DO NOT EDIT! (description) +The error-handler is a platform trait used to inject Error Handler source into the integration runtime. + + +This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. + +WARNING: The error-handler trait is a *platform trait*: disabling it may compromise the platform functionality. + +// End of autogenerated code - DO NOT EDIT! (description) +// Start of autogenerated code - DO NOT EDIT! (configuration) +== Configuration + +Trait properties can be specified when running any integration with the CLI: +[source,console] +---- +$ kamel run --trait error-handler.[key]=[value] integration.groovy +---- +The following configuration options are available: + +[cols="2m,1m,5a"] +|=== +|Property | Type | Description + +| error-handler.enabled +| bool +| Can be used to enable or disable a trait. All traits share this common property. + +|=== + +// End of autogenerated code - DO NOT EDIT! (configuration) diff --git a/pkg/trait/error_handler.go b/pkg/trait/error_handler.go index 228ed12..ef93d67 100644 --- a/pkg/trait/error_handler.go +++ b/pkg/trait/error_handler.go @@ -23,17 +23,16 @@ import ( v1 "github.com/apache/camel-k/pkg/apis/camel/v1" ) -// The error handler is a platform trait used to inject Error Handler source into the integration runtime. +// The error-handler is a platform trait used to inject Error Handler source into the integration runtime. // // +camel-k:trait=error-handler type errorHandlerTrait struct { BaseTrait `property:",squash"` - Auto *bool `property:"auto"` } func newErrorHandlerTrait() Trait { return &errorHandlerTrait{ - BaseTrait: NewBaseTrait("errorHandler", 500), + BaseTrait: NewBaseTrait("error-handler", 500), } } diff --git a/pkg/trait/trait_test.go b/pkg/trait/trait_test.go index b8fdca8..e1bea3b 100644 --- a/pkg/trait/trait_test.go +++ b/pkg/trait/trait_test.go @@ -507,7 +507,7 @@ func TestOnlySomeTraitsInfluenceBuild(t *testing.T) { func TestOnlySomeTraitsArePlatform(t *testing.T) { c := NewTraitTestCatalog() - platformTraits := []string{"builder", "camel", "jvm", "container", "dependencies", "deployer", "deployment", "environment", "errorHandler", "kamelets", "openapi", "owner", "platform", "quarkus"} + platformTraits := []string{"builder", "camel", "jvm", "container", "dependencies", "deployer", "deployment", "environment", "error-handler", "kamelets", "openapi", "owner", "platform", "quarkus"} for _, trait := range c.allTraits() { if trait.IsPlatformTrait() {
