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/30 13:28:44 UTC

[camel-kamelets] 02/04: fix tests and document

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-kamelets.git

commit da145639f918b0c07f2b2470d369f41a924517e6
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Fri Apr 30 14:22:19 2021 +0200

    fix tests and document
---
 .../ROOT/assets/images/kamelets/insert-field.svg   | 59 ++++++++++++++++++
 docs/modules/ROOT/nav.adoc                         |  1 +
 docs/modules/ROOT/pages/insert-field.adoc          | 69 ++++++++++++++++++++++
 test/insert-field-action/yaks-config.yaml          |  2 +-
 4 files changed, 130 insertions(+), 1 deletion(-)

diff --git a/docs/modules/ROOT/assets/images/kamelets/insert-field.svg b/docs/modules/ROOT/assets/images/kamelets/insert-field.svg
new file mode 100644
index 0000000..fa06352
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/insert-field.svg
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 -256 1792 1792"
+   id="svg3025"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   width="100%"
+   height="100%"
+   sodipodi:docname="cog_font_awesome.svg">
+  <metadata
+     id="metadata3035">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3033" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="640"
+     inkscape:window-height="480"
+     id="namedview3031"
+     showgrid="false"
+     inkscape:zoom="0.13169643"
+     inkscape:cx="896"
+     inkscape:cy="896"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg3025" />
+  <g
+     transform="matrix(1,0,0,-1,121.49153,1285.4237)"
+     id="g3027">
+    <path
+       d="m 1024,640 q 0,106 -75,181 -75,75 -181,75 -106,0 -181,-75 -75,-75 -75,-181 0,-106 75,-181 75,-75 181,-75 106,0 181,75 75,75 75,181 z m 512,109 V 527 q 0,-12 -8,-23 -8,-11 -20,-13 l -185,-28 q -19,-54 -39,-91 35,-50 107,-138 10,-12 10,-25 0,-13 -9,-23 -27,-37 -99,-108 -72,-71 -94,-71 -12,0 -26,9 l -138,108 q -44,-23 -91,-38 -16,-136 -29,-186 -7,-28 -36,-28 H 657 q -14,0 -24.5,8.5 Q 622,-111 621,-98 L 593,86 q -49,16 -90,37 L 362,16 Q 352,7 337,7 323,7 312,18 186,132 147,186 q -7 [...]
+       id="path3029"
+       inkscape:connector-curvature="0"
+       style="fill:currentColor" />
+  </g>
+</svg>
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 818755a..796b4bc 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -42,6 +42,7 @@
 * xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink]
 * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source]
 * xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source]
+* xref:ROOT:insert-field.adoc[image:kamelets/insert-field.svg[] Insert Field]
 * xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source]
 * xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source]
 * xref:ROOT:mail-imap-source.adoc[image:kamelets/mail-imap-source.svg[] Mail IMAP Source]
diff --git a/docs/modules/ROOT/pages/insert-field.adoc b/docs/modules/ROOT/pages/insert-field.adoc
new file mode 100644
index 0000000..8865775
--- /dev/null
+++ b/docs/modules/ROOT/pages/insert-field.adoc
@@ -0,0 +1,69 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/insert-field.svg[] Insert Field
+
+*Provided by: "Apache Software Foundation"*
+
+Adds a custom field with a constant value to the message in transit
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `insert-field` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *field {empty}* *| Field| The name of the field to be added| string| | 
+| *value {empty}* *| Value| The value of the field| string| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `insert-field` can be used in various contexts.
+
+=== Knative Action
+
+The `insert-field` Kamelet can be used as intermediate step in a binding.
+
+.insert-field-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: insert-field-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: timer-source
+    properties:
+      message: "Hello"
+  steps:
+  - ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: insert-field
+    properties:
+      field: "The Field"
+      value: "The Value"
+  sink:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+
+----
+
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `insert-field-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the action using the following command:
+
+[source,shell]
+----
+kubectl apply -f insert-field-binding.yaml
+----
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/test/insert-field-action/yaks-config.yaml b/test/insert-field-action/yaks-config.yaml
index b621d04..16e9150 100644
--- a/test/insert-field-action/yaks-config.yaml
+++ b/test/insert-field-action/yaks-config.yaml
@@ -26,4 +26,4 @@ pre:
     kamel install -n $YAKS_NAMESPACE
     kubectl apply -f ../../timer-source.kamelet.yaml -n $YAKS_NAMESPACE
     kubectl apply -f ../../insert-field-action.kamelet.yaml -n $YAKS_NAMESPACE
-    kubectl apply -f insert-field-binding.yaml -n $YAKS_NAMESPACE
+    kubectl apply -f insert-field-action-binding.yaml -n $YAKS_NAMESPACE