From 782b75ec626c042d8af01225151bcb8eccaa44e1 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Wed, 11 Oct 2023 16:43:00 +0200 Subject: [PATCH] chore: change deprecated yaml statements Closes #3229 --- .../bases/camel-k.clusterserviceversion.yaml | 2 +- .../samples/bases/camel_v1_integration.yaml | 2 +- config/samples/bases/camel_v1_kamelet.yaml | 2 +- .../schema/integration-schema.json | 4 +- .../attachments/schema/kamelet-schema.json | 4 +- .../ROOT/pages/kamelets/kamelets-dev.adoc | 54 +++++++++---------- e2e/common/cli/files/run.yaml | 2 +- e2e/common/cli/files/yaml.yaml | 4 +- e2e/common/languages/files/yaml-polyglot.yaml | 4 +- e2e/common/languages/files/yaml.yaml | 4 +- e2e/common/misc/files/cron-fallback.yaml | 8 +-- e2e/common/misc/files/cron-quartz.yaml | 8 +-- e2e/common/misc/files/cron-timer.yaml | 9 ++-- e2e/common/misc/files/cron-yaml.yaml | 4 +- e2e/common/misc/files/cron.yaml | 8 +-- .../kamelets/timer-custom-source.kamelet.yaml | 4 +- .../misc/files/my-timer-source.kamelet.yaml | 4 +- e2e/common/misc/files/rest-consumer.yaml | 2 +- e2e/common/misc/files/yaml.yaml | 4 +- e2e/common/misc/kamelet_test.go | 4 +- e2e/common/misc/pipe_test.go | 4 +- e2e/commonwithcustominstall/files/yaml.yaml | 4 +- e2e/install/cli/files/yaml.yaml | 4 +- e2e/install/helm/files/yaml.yaml | 4 +- e2e/install/kustomize/files/yaml.yaml | 4 +- e2e/install/olm/files/yaml.yaml | 4 +- e2e/install/upgrade/files/yaml.yaml | 4 +- e2e/knative/files/flow.yaml | 2 +- e2e/knative/files/yaml.yaml | 4 +- e2e/native/files/yaml.yaml | 4 +- e2e/native/files/yaml2.yaml | 4 +- e2e/support/test_support.go | 2 +- e2e/telemetry/files/rest-consumer.yaml | 2 +- .../kamelet-beans/beans-source.kamelet.yaml | 2 +- .../timer-source.kamelet.yaml | 2 +- .../timer-source.kamelet.yaml | 2 +- .../timer-source.kamelet.yaml | 2 +- .../timer-source.kamelet.yaml | 4 +- .../kamelet-binding/timer-source.kamelet.yaml | 2 +- .../event-source.kamelet.yaml | 2 +- .../kamelet-no-props.feature | 2 +- .../kamelet-steps/prefix-action.kamelet.yaml | 2 +- .../kamelet-steps/timer-source.kamelet.yaml | 2 +- .../common/kamelet/echo-sink.kamelet.yaml | 2 +- .../common/kamelet/timer-source.kamelet.yaml | 2 +- .../common/knative-sinkbinding/source.yaml | 2 +- .../testdata/timer-source.kamelet.yaml | 2 +- pkg/metadata/metadata_dependencies_test.go | 2 +- pkg/util/modeline/parser_test.go | 30 +++++------ pkg/util/source/inspector_yaml_test.go | 12 ++--- 50 files changed, 128 insertions(+), 129 deletions(-) diff --git a/config/manifests/bases/camel-k.clusterserviceversion.yaml b/config/manifests/bases/camel-k.clusterserviceversion.yaml index ed0a410a9f..3597a23a71 100644 --- a/config/manifests/bases/camel-k.clusterserviceversion.yaml +++ b/config/manifests/bases/camel-k.clusterserviceversion.yaml @@ -23,7 +23,7 @@ metadata: categories: Integration & Delivery certified: "false" containerImage: docker.io/apache/camel-k:2.1.0-SNAPSHOT - createdAt: 2023-10-06T14:14:36Z + createdAt: 2023-10-16T08:21:55Z description: Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers. operators.operatorframework.io/builder: operator-sdk-v1.16.0 diff --git a/config/samples/bases/camel_v1_integration.yaml b/config/samples/bases/camel_v1_integration.yaml index 0b58d2527e..b93303779d 100644 --- a/config/samples/bases/camel_v1_integration.yaml +++ b/config/samples/bases/camel_v1_integration.yaml @@ -26,6 +26,6 @@ spec: parameters: period: '1000' steps: - - set-body: + - setBody: constant: Hello from Camel K - to: log:info diff --git a/config/samples/bases/camel_v1_kamelet.yaml b/config/samples/bases/camel_v1_kamelet.yaml index b40b661863..4e1871a53c 100644 --- a/config/samples/bases/camel_v1_kamelet.yaml +++ b/config/samples/bases/camel_v1_kamelet.yaml @@ -40,7 +40,7 @@ spec: parameters: period: "#property:period" steps: - - set-body: + - setBody: constant: "#property:message" - to: kamelet:sink uri: timer:tick diff --git a/docs/modules/ROOT/attachments/schema/integration-schema.json b/docs/modules/ROOT/attachments/schema/integration-schema.json index c1117d555a..4748720cab 100644 --- a/docs/modules/ROOT/attachments/schema/integration-schema.json +++ b/docs/modules/ROOT/attachments/schema/integration-schema.json @@ -9315,13 +9315,13 @@ "service-call": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.ServiceCallStepParser$Definition" }, - "set-body": { + "setBody": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetBodyStepParser$Definition" }, "set-exchange-pattern": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetExchangePatternStepParser$Definition" }, - "set-header": { + "setHeader": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetHeaderStepParser$Definition" }, "set-property": { diff --git a/docs/modules/ROOT/attachments/schema/kamelet-schema.json b/docs/modules/ROOT/attachments/schema/kamelet-schema.json index 3c5802b99a..33462d7e28 100644 --- a/docs/modules/ROOT/attachments/schema/kamelet-schema.json +++ b/docs/modules/ROOT/attachments/schema/kamelet-schema.json @@ -4619,13 +4619,13 @@ "service-call": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.ServiceCallStepParser$Definition" }, - "set-body": { + "setBody": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetBodyStepParser$Definition" }, "set-exchange-pattern": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetExchangePatternStepParser$Definition" }, - "set-header": { + "setHeader": { "$ref": "#/definitions/org.apache.camel.k.loader.yaml.parser.SetHeaderStepParser$Definition" }, "set-property": { diff --git a/docs/modules/ROOT/pages/kamelets/kamelets-dev.adoc b/docs/modules/ROOT/pages/kamelets/kamelets-dev.adoc index a6bcb520c7..23e90e59a7 100644 --- a/docs/modules/ROOT/pages/kamelets/kamelets-dev.adoc +++ b/docs/modules/ROOT/pages/kamelets/kamelets-dev.adoc @@ -84,7 +84,7 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" ---- @@ -734,7 +734,7 @@ If we managed to reduce our integration to contain only a Camel route, convertin parameters: period: "{{period}}" steps: - - set-header: + - setHeader: name: CamelCaffeineAction constant: GET - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -750,7 +750,7 @@ If we managed to reduce our integration to contain only a Camel route, convertin - set-property: name: lastUpdate simple: "${date-with-timezone:now-{{lookAhead}}m:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - - set-header: + - setHeader: name: CamelHttpMethod constant: GET - toD: "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&updatedafter=${exchangeProperty.lastUpdate}&orderby=time-asc" @@ -764,9 +764,9 @@ If we managed to reduce our integration to contain only a Camel route, convertin simple: "${date-with-timezone:exchangeProperty.generated:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - claim-check: operation: Push - - set-body: + - setBody: exchange-property: lastUpdate - - set-header: + - setHeader: name: CamelCaffeineAction constant: PUT - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -815,7 +815,7 @@ spec: parameters: period: "{{period}}" steps: - - set-header: + - setHeader: name: CamelCaffeineAction constant: GET - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -831,7 +831,7 @@ spec: - set-property: name: lastUpdate simple: "${date-with-timezone:now-{{lookAhead}}m:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - - set-header: + - setHeader: name: CamelHttpMethod constant: GET - toD: "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&updatedafter=${exchangeProperty.lastUpdate}&orderby=time-asc" @@ -845,9 +845,9 @@ spec: simple: "${date-with-timezone:exchangeProperty.generated:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - claim-check: operation: Push - - set-body: + - setBody: exchange-property: lastUpdate - - set-header: + - setHeader: name: CamelCaffeineAction constant: PUT - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -957,7 +957,7 @@ spec: parameters: period: "{{period}}" steps: - - set-header: + - setHeader: name: CamelCaffeineAction constant: GET - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -973,7 +973,7 @@ spec: - set-property: name: lastUpdate simple: "${date-with-timezone:now-{{lookAhead}}m:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - - set-header: + - setHeader: name: CamelHttpMethod constant: GET - toD: "https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&updatedafter=${exchangeProperty.lastUpdate}&orderby=time-asc" @@ -987,9 +987,9 @@ spec: simple: "${date-with-timezone:exchangeProperty.generated:UTC:yyyy-MM-dd'T'HH:mm:ss.SSS}" - claim-check: operation: Push - - set-body: + - setBody: exchange-property: lastUpdate - - set-header: + - setHeader: name: CamelCaffeineAction constant: PUT - toD: "caffeine-cache:cache-${routeId}?key=lastUpdate" @@ -1113,7 +1113,7 @@ Let's start with a simple integration: parameters: period: 5000 steps: - - set-body: + - setBody: constant: Hello - to: direct:endpoint ---- @@ -1144,7 +1144,7 @@ Now, let's check if we can also send an image, by changing the second route: parameters: period: 5000 steps: - - set-header: + - setHeader: name: CamelHttpMethod constant: GET - to: https://github.com/apache/camel/raw/7204aa132662ab6cb8e3c5afea8b9b0859eff0e8/docs/img/logo.png @@ -1178,14 +1178,14 @@ When applied to the current use case, the main route can be changed into somethi steps: - convert-body-to: type: "byte[]" - - set-header: + - setHeader: name: CamelTelegramMediaType constant: PHOTO_PNG - simple: "${header[Content-Type]} == 'image/jpeg'" steps: - convert-body-to: type: "byte[]" - - set-header: + - setHeader: name: CamelTelegramMediaType constant: PHOTO_JPG otherwise: @@ -1196,24 +1196,24 @@ When applied to the current use case, the main route can be changed into somethi when: - simple: "${header[text]}" steps: - - set-header: + - setHeader: name: CamelTelegramMediaTitleCaption simple: "${header[text]}" - simple: "${header[ce-text]}" steps: - - set-header: + - setHeader: name: CamelTelegramMediaTitleCaption simple: "${header[ce-text]}" - choice: # <3> when: - simple: "${header[chat-id]}" steps: - - set-header: + - setHeader: name: CamelTelegramChatId simple: "${header[chat-id]}" - simple: "${header[ce-chat-id]}" steps: - - set-header: + - setHeader: name: CamelTelegramChatId simple: "${header[ce-chat-id]}" - to: @@ -1294,14 +1294,14 @@ spec: - log: h1 - convert-body-to: type: "byte[]" - - set-header: + - setHeader: name: CamelTelegramMediaType constant: PHOTO_PNG - simple: "${header[Content-Type]} == 'image/jpeg'" steps: - convert-body-to: type: "byte[]" - - set-header: + - setHeader: name: CamelTelegramMediaType constant: PHOTO_JPG otherwise: @@ -1312,24 +1312,24 @@ spec: when: - simple: "${header[text]}" steps: - - set-header: + - setHeader: name: CamelTelegramMediaTitleCaption simple: "${header[text]}" - simple: "${header[ce-text]}" steps: - - set-header: + - setHeader: name: CamelTelegramMediaTitleCaption simple: "${header[ce-text]}" - choice: when: - simple: "${header[chat-id]}" steps: - - set-header: + - setHeader: name: CamelTelegramChatId simple: "${header[chat-id]}" - simple: "${header[ce-chat-id]}" steps: - - set-header: + - setHeader: name: CamelTelegramChatId simple: "${header[ce-chat-id]}" - to: diff --git a/e2e/common/cli/files/run.yaml b/e2e/common/cli/files/run.yaml index e9dc02507e..1f55bd691c 100644 --- a/e2e/common/cli/files/run.yaml +++ b/e2e/common/cli/files/run.yaml @@ -20,6 +20,6 @@ parameters: period: "5000" steps: - - set-body: + - setBody: simple: "Magic {{property:default}}" - to: "log:info" diff --git a/e2e/common/cli/files/yaml.yaml b/e2e/common/cli/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/common/cli/files/yaml.yaml +++ b/e2e/common/cli/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/common/languages/files/yaml-polyglot.yaml b/e2e/common/languages/files/yaml-polyglot.yaml index 0634d2fa6a..6ba0332293 100644 --- a/e2e/common/languages/files/yaml-polyglot.yaml +++ b/e2e/common/languages/files/yaml-polyglot.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "polyglot-yaml" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/common/languages/files/yaml.yaml b/e2e/common/languages/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/common/languages/files/yaml.yaml +++ b/e2e/common/languages/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/common/misc/files/cron-fallback.yaml b/e2e/common/misc/files/cron-fallback.yaml index c80e309b72..f20d0f21a9 100644 --- a/e2e/common/misc/files/cron-fallback.yaml +++ b/e2e/common/misc/files/cron-fallback.yaml @@ -15,17 +15,17 @@ # limitations under the License. # --------------------------------------------------------------------------- -- from: +- from: uri: "cron:tab" parameters: schedule: "0/1 * * * * ?" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - - to: + - to: uri: "log:info" parameters: show-all: "false" diff --git a/e2e/common/misc/files/cron-quartz.yaml b/e2e/common/misc/files/cron-quartz.yaml index 6fcce4f73a..074367a3cb 100644 --- a/e2e/common/misc/files/cron-quartz.yaml +++ b/e2e/common/misc/files/cron-quartz.yaml @@ -17,17 +17,17 @@ - route: id: "yaml" - from: + from: uri: "quartz:trigger" parameters: cron: "0/1 * * * * ?" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - - to: + - to: uri: "log:info" parameters: show-all: "false" diff --git a/e2e/common/misc/files/cron-timer.yaml b/e2e/common/misc/files/cron-timer.yaml index 707d1974c7..4acd7a8c2e 100644 --- a/e2e/common/misc/files/cron-timer.yaml +++ b/e2e/common/misc/files/cron-timer.yaml @@ -17,18 +17,17 @@ - route: id: "yaml" - from: + from: uri: "timer:tick" parameters: period: "60000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - - to: + - to: uri: "log:info" parameters: show-all: "false" - \ No newline at end of file diff --git a/e2e/common/misc/files/cron-yaml.yaml b/e2e/common/misc/files/cron-yaml.yaml index e017285286..9b67350532 100644 --- a/e2e/common/misc/files/cron-yaml.yaml +++ b/e2e/common/misc/files/cron-yaml.yaml @@ -20,10 +20,10 @@ parameters: schedule: "* * * * ?" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: uri: "log:info" diff --git a/e2e/common/misc/files/cron.yaml b/e2e/common/misc/files/cron.yaml index 4290e10384..9b67350532 100644 --- a/e2e/common/misc/files/cron.yaml +++ b/e2e/common/misc/files/cron.yaml @@ -15,17 +15,17 @@ # limitations under the License. # --------------------------------------------------------------------------- -- from: +- from: uri: "cron:tab" parameters: schedule: "* * * * ?" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - - to: + - to: uri: "log:info" parameters: show-all: "false" diff --git a/e2e/common/misc/files/kamelets/timer-custom-source.kamelet.yaml b/e2e/common/misc/files/kamelets/timer-custom-source.kamelet.yaml index f406c5acae..f9950030c2 100644 --- a/e2e/common/misc/files/kamelets/timer-custom-source.kamelet.yaml +++ b/e2e/common/misc/files/kamelets/timer-custom-source.kamelet.yaml @@ -61,9 +61,9 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - - set-header: + - setHeader: name: "Content-Type" constant: "{{contentType}}" - to: kamelet:sink diff --git a/e2e/common/misc/files/my-timer-source.kamelet.yaml b/e2e/common/misc/files/my-timer-source.kamelet.yaml index cf25365006..c260087268 100644 --- a/e2e/common/misc/files/my-timer-source.kamelet.yaml +++ b/e2e/common/misc/files/my-timer-source.kamelet.yaml @@ -61,9 +61,9 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - - set-header: + - setHeader: name: "Content-Type" constant: "{{contentType}}" - to: kamelet:sink diff --git a/e2e/common/misc/files/rest-consumer.yaml b/e2e/common/misc/files/rest-consumer.yaml index b7b8e26bbb..e948b78b68 100644 --- a/e2e/common/misc/files/rest-consumer.yaml +++ b/e2e/common/misc/files/rest-consumer.yaml @@ -25,5 +25,5 @@ steps: - log: message: "get ${header.name}" - - set-body: + - setBody: simple: "${header.name} Doe" diff --git a/e2e/common/misc/files/yaml.yaml b/e2e/common/misc/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/common/misc/files/yaml.yaml +++ b/e2e/common/misc/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/common/misc/kamelet_test.go b/e2e/common/misc/kamelet_test.go index 7a720a46b2..6de1b1999c 100644 --- a/e2e/common/misc/kamelet_test.go +++ b/e2e/common/misc/kamelet_test.go @@ -100,9 +100,9 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - - set-header: + - setHeader: name: "Content-Type" constant: "{{contentType}}" - to: kamelet:sink diff --git a/e2e/common/misc/pipe_test.go b/e2e/common/misc/pipe_test.go index 2130081691..75c3571d6b 100644 --- a/e2e/common/misc/pipe_test.go +++ b/e2e/common/misc/pipe_test.go @@ -127,12 +127,12 @@ func createErrorProducerKamelet(ns string, name string) func() error { "uri": "timer:tick", "steps": []map[string]interface{}{ { - "set-body": map[string]interface{}{ + "setBody": map[string]interface{}{ "constant": "{{message}}", }, }, { - "set-body": map[string]interface{}{ + "setBody": map[string]interface{}{ "simple": "${mandatoryBodyAs(Boolean)}", }, }, diff --git a/e2e/commonwithcustominstall/files/yaml.yaml b/e2e/commonwithcustominstall/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/commonwithcustominstall/files/yaml.yaml +++ b/e2e/commonwithcustominstall/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/install/cli/files/yaml.yaml b/e2e/install/cli/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/install/cli/files/yaml.yaml +++ b/e2e/install/cli/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/install/helm/files/yaml.yaml b/e2e/install/helm/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/install/helm/files/yaml.yaml +++ b/e2e/install/helm/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/install/kustomize/files/yaml.yaml b/e2e/install/kustomize/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/install/kustomize/files/yaml.yaml +++ b/e2e/install/kustomize/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/install/olm/files/yaml.yaml b/e2e/install/olm/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/install/olm/files/yaml.yaml +++ b/e2e/install/olm/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/install/upgrade/files/yaml.yaml b/e2e/install/upgrade/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/install/upgrade/files/yaml.yaml +++ b/e2e/install/upgrade/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/knative/files/flow.yaml b/e2e/knative/files/flow.yaml index 2108deb5ff..0742e95223 100644 --- a/e2e/knative/files/flow.yaml +++ b/e2e/knative/files/flow.yaml @@ -18,6 +18,6 @@ - from: uri: "knative:endpoint/example" steps: - - set-body: + - setBody: constant: "Hello Camel K from yaml" - to: "log:info" \ No newline at end of file diff --git a/e2e/knative/files/yaml.yaml b/e2e/knative/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/knative/files/yaml.yaml +++ b/e2e/knative/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/native/files/yaml.yaml b/e2e/native/files/yaml.yaml index 9ccf652734..8877c8557d 100644 --- a/e2e/native/files/yaml.yaml +++ b/e2e/native/files/yaml.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}" - to: "log:info" diff --git a/e2e/native/files/yaml2.yaml b/e2e/native/files/yaml2.yaml index d717e5da6b..047e0a4e99 100644 --- a/e2e/native/files/yaml2.yaml +++ b/e2e/native/files/yaml2.yaml @@ -20,9 +20,9 @@ parameters: period: "5000" steps: - - set-header: + - setHeader: name: "m" constant: "string!" - - set-body: + - setBody: simple: "Magic${header.m}2" - to: "log:info" diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index bbb10228fd..7b57a711b1 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -2463,7 +2463,7 @@ func CreateTimerKamelet(ns string, name string) func() error { "uri": "timer:tick", "steps": []map[string]interface{}{ { - "set-body": map[string]interface{}{ + "setBody": map[string]interface{}{ "constant": "{{message}}", }, }, diff --git a/e2e/telemetry/files/rest-consumer.yaml b/e2e/telemetry/files/rest-consumer.yaml index b7b8e26bbb..e948b78b68 100644 --- a/e2e/telemetry/files/rest-consumer.yaml +++ b/e2e/telemetry/files/rest-consumer.yaml @@ -25,5 +25,5 @@ steps: - log: message: "get ${header.name}" - - set-body: + - setBody: simple: "${header.name} Doe" diff --git a/e2e/yaks/common/kamelet-beans/beans-source.kamelet.yaml b/e2e/yaks/common/kamelet-beans/beans-source.kamelet.yaml index 2847d908da..15c9938552 100644 --- a/e2e/yaks/common/kamelet-beans/beans-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-beans/beans-source.kamelet.yaml @@ -32,6 +32,6 @@ spec: from: uri: timer:tick steps: - - set-body: + - setBody: simple: "Bean time is ${bean:{{myBean}}?method=getTime}!" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-binding-autoload/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-binding-autoload/timer-source.kamelet.yaml index 52bf905a81..48ce59f3c0 100644 --- a/e2e/yaks/common/kamelet-binding-autoload/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-binding-autoload/timer-source.kamelet.yaml @@ -43,6 +43,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-binding-broker/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-binding-broker/timer-source.kamelet.yaml index 0b1adc0071..e6a9922a78 100644 --- a/e2e/yaks/common/kamelet-binding-broker/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-binding-broker/timer-source.kamelet.yaml @@ -51,6 +51,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml index 0b1adc0071..e6a9922a78 100644 --- a/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-binding-http/timer-source.kamelet.yaml @@ -51,6 +51,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-binding-property-encoding/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-binding-property-encoding/timer-source.kamelet.yaml index 1f2af14afd..a313574054 100644 --- a/e2e/yaks/common/kamelet-binding-property-encoding/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-binding-property-encoding/timer-source.kamelet.yaml @@ -61,9 +61,9 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - - set-header: + - setHeader: name: "Content-Type" constant: "{{contentType}}" - to: kamelet:sink diff --git a/e2e/yaks/common/kamelet-binding/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-binding/timer-source.kamelet.yaml index 0b1adc0071..e6a9922a78 100644 --- a/e2e/yaks/common/kamelet-binding/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-binding/timer-source.kamelet.yaml @@ -51,6 +51,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml b/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml index 547d2272d4..20993c006b 100644 --- a/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml @@ -40,6 +40,6 @@ spec: from: uri: timer:tick steps: - - set-body: + - setBody: constant: "Hello from Camel K!" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet-no-properties/kamelet-no-props.feature b/e2e/yaks/common/kamelet-no-properties/kamelet-no-props.feature index 6f6b42afcf..d2864e8ea2 100644 --- a/e2e/yaks/common/kamelet-no-properties/kamelet-no-props.feature +++ b/e2e/yaks/common/kamelet-no-properties/kamelet-no-props.feature @@ -13,7 +13,7 @@ Feature: Kamelet may have no properties from: uri: timer:tick steps: - - set-body: + - setBody: constant: "Hello World" - to: "kamelet:sink" """ diff --git a/e2e/yaks/common/kamelet-steps/prefix-action.kamelet.yaml b/e2e/yaks/common/kamelet-steps/prefix-action.kamelet.yaml index cb0e17959e..abde729134 100644 --- a/e2e/yaks/common/kamelet-steps/prefix-action.kamelet.yaml +++ b/e2e/yaks/common/kamelet-steps/prefix-action.kamelet.yaml @@ -45,5 +45,5 @@ spec: from: uri: "kamelet:source" steps: - - set-body: + - setBody: simple: "{{prefix}} ${body}" diff --git a/e2e/yaks/common/kamelet-steps/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet-steps/timer-source.kamelet.yaml index 0b1adc0071..e6a9922a78 100644 --- a/e2e/yaks/common/kamelet-steps/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet-steps/timer-source.kamelet.yaml @@ -51,6 +51,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/kamelet/echo-sink.kamelet.yaml b/e2e/yaks/common/kamelet/echo-sink.kamelet.yaml index e92ea2dcc9..dad99bd633 100644 --- a/e2e/yaks/common/kamelet/echo-sink.kamelet.yaml +++ b/e2e/yaks/common/kamelet/echo-sink.kamelet.yaml @@ -46,5 +46,5 @@ spec: from: uri: "kamelet:source" steps: - - set-body: + - setBody: simple: "{{prefix}}${body}" diff --git a/e2e/yaks/common/kamelet/timer-source.kamelet.yaml b/e2e/yaks/common/kamelet/timer-source.kamelet.yaml index 0b1adc0071..e6a9922a78 100644 --- a/e2e/yaks/common/kamelet/timer-source.kamelet.yaml +++ b/e2e/yaks/common/kamelet/timer-source.kamelet.yaml @@ -51,6 +51,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/e2e/yaks/common/knative-sinkbinding/source.yaml b/e2e/yaks/common/knative-sinkbinding/source.yaml index 9ec23fa81e..96127b2541 100644 --- a/e2e/yaks/common/knative-sinkbinding/source.yaml +++ b/e2e/yaks/common/knative-sinkbinding/source.yaml @@ -20,7 +20,7 @@ parameters: period: "1000" steps: - - set-body: + - setBody: constant: "Hello SinkBinding !!!" - transform: simple: "${body.toUpperCase()}" diff --git a/pkg/install/testdata/timer-source.kamelet.yaml b/pkg/install/testdata/timer-source.kamelet.yaml index 829a3a5750..3058964c2e 100644 --- a/pkg/install/testdata/timer-source.kamelet.yaml +++ b/pkg/install/testdata/timer-source.kamelet.yaml @@ -52,6 +52,6 @@ spec: parameters: period: "{{period}}" steps: - - set-body: + - setBody: constant: "{{message}}" - to: "kamelet:sink" diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go index 45d3bb1aa3..d28fde73a9 100644 --- a/pkg/metadata/metadata_dependencies_test.go +++ b/pkg/metadata/metadata_dependencies_test.go @@ -691,7 +691,7 @@ const yamlWithLanguages = ` - from: uri: "direct:start" steps: - - set-body: + - setBody: constant: "Hello Camel K" - transform: language: diff --git a/pkg/util/modeline/parser_test.go b/pkg/util/modeline/parser_test.go index b03e711c5f..204ee00883 100644 --- a/pkg/util/modeline/parser_test.go +++ b/pkg/util/modeline/parser_test.go @@ -25,7 +25,7 @@ import ( func TestParseGroovyFile(t *testing.T) { it := ` - // camel-k: pippo=pluto paperino ciao=1 + // camel-k: pippo=pluto paperino ciao=1 // camel-k : ciao from("timer:tick").log("Ciao") @@ -41,7 +41,7 @@ func TestParseGroovyFile(t *testing.T) { func TestParseKotlinFile(t *testing.T) { it := ` - // camel-k: pippo=pluto paperino ciao=1 + // camel-k: pippo=pluto paperino ciao=1 // camel-k : ciao from("timer:tick").log("Ciao") @@ -57,22 +57,22 @@ func TestParseKotlinFile(t *testing.T) { func TestParseJavaFile(t *testing.T) { it := ` - // camel-k: pippo=pluto paperino ciao=1 + // camel-k: pippo=pluto paperino ciao=1 // camel-k : ciao import org.apache.camel.builder.RouteBuilder; - + public class {{ .Name }} extends RouteBuilder { @Override public void configure() throws Exception { - + // Write your routes here, for example: from("timer:java?period=1000") .routeId("java") .setBody() .simple("Hello Camel K from ${routeId}") .to("log:info"); - + } } ` @@ -87,8 +87,8 @@ func TestParseJavaFile(t *testing.T) { func TestParseJSFile(t *testing.T) { it := ` - // camel-k: pippo=pluto paperino ciao=1 - // camel-k : ciao + // camel-k: pippo=pluto paperino ciao=1 + // camel-k : ciao // Write your routes here, for example: from('timer:js?period=1000') .routeId('js') @@ -107,8 +107,8 @@ func TestParseJSFile(t *testing.T) { func TestParseYAMLFile(t *testing.T) { it := ` - # camel-k: pippo=pluto paperino ciao=1 - ### camel-k : ciao + # camel-k: pippo=pluto paperino ciao=1 + ### camel-k : ciao # Write your routes here, for example: - from: @@ -116,7 +116,7 @@ func TestParseYAMLFile(t *testing.T) { parameters: period: "1000" steps: - - set-body: + - setBody: constant: "Hello Camel K from yaml" - to: "log:info" @@ -132,8 +132,8 @@ func TestParseYAMLFile(t *testing.T) { func TestParseXMLFile(t *testing.T) { it := ` - # camel-k: pippo=pluto paperino ciao=1 - ### camel-k : ciao + # camel-k: pippo=pluto paperino ciao=1 + ### camel-k : ciao @@ -145,7 +145,7 @@ func TestParseXMLFile(t *testing.T) { xsi:schemaLocation=" http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd"> - + @@ -154,7 +154,7 @@ func TestParseXMLFile(t *testing.T) { - + diff --git a/pkg/util/source/inspector_yaml_test.go b/pkg/util/source/inspector_yaml_test.go index 145d4a312e..de6d394d42 100644 --- a/pkg/util/source/inspector_yaml_test.go +++ b/pkg/util/source/inspector_yaml_test.go @@ -191,7 +191,7 @@ const yamlRestDSL = ` simple: "${body.contains(\",\")}" - split: tokenize: ";" - - set-body: + - setBody: simple: "${body.toLowerCase()}" - to: uri: "log:out" @@ -215,7 +215,7 @@ const yamlRestDSLWithRoute = ` simple: "${body.contains(\",\")}" - split: tokenize: ";" - - set-body: + - setBody: simple: "${body.toLowerCase()}" - to: uri: "log:out" @@ -244,7 +244,7 @@ const yamlFromDSL = ` parameters: period: "5000" steps: - - set-body: + - setBody: constant: "Hello Yaml !!!" - transform: simple: "${body.toUpperCase()}" @@ -259,7 +259,7 @@ const yamlFromDSLWithRoute = ` parameters: period: "5000" steps: - - set-body: + - setBody: constant: "Hello Yaml !!!" - transform: simple: "${body.toUpperCase()}" @@ -555,7 +555,7 @@ const yamlFromDSLWithPropertyPlaceholder = ` parameters: period: "5000" steps: - - set-body: + - setBody: constant: "Hello Yaml !!!" - transform: simple: "${body.toUpperCase()}" @@ -570,7 +570,7 @@ const yamlFromDSLWithPropertyPlaceholderScheme = ` parameters: period: "5000" steps: - - set-body: + - setBody: constant: "Hello Yaml !!!" - transform: simple: "${body.toUpperCase()}"