From 4803bc2951e5cac4d10f38c4a4261591779951d9 Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Thu, 13 Jun 2024 23:17:31 +0200 Subject: [PATCH] chore: Adjust Camel K Kamelet examples --- examples/kamelets/hello-source.kamelet.yaml | 4 +-- examples/kamelets/hello-to-log-binding.yaml | 2 +- ...t-binding.feature => kamelet-pipe.feature} | 27 +++++++------------ examples/kamelets/kamelet-resource.feature | 7 ----- examples/kamelets/kamelet.feature | 7 ----- examples/kamelets/yaks-config.yaml | 10 +++++-- 6 files changed, 21 insertions(+), 36 deletions(-) rename examples/kamelets/{kamelet-binding.feature => kamelet-pipe.feature} (50%) diff --git a/examples/kamelets/hello-source.kamelet.yaml b/examples/kamelets/hello-source.kamelet.yaml index 32a77da3..e3afcf5a 100644 --- a/examples/kamelets/hello-source.kamelet.yaml +++ b/examples/kamelets/hello-source.kamelet.yaml @@ -14,7 +14,7 @@ # limitations under the License. # --------------------------------------------------------------------------- -apiVersion: camel.apache.org/v1alpha1 +apiVersion: camel.apache.org/v1 kind: Kamelet metadata: name: hello-source @@ -41,5 +41,5 @@ spec: period: "{{period}}" steps: - set-body: - constant: "Hello world!" + constant: "Hello World!" - to: "kamelet:sink" diff --git a/examples/kamelets/hello-to-log-binding.yaml b/examples/kamelets/hello-to-log-binding.yaml index 9cd9ce75..d8b30fa6 100644 --- a/examples/kamelets/hello-to-log-binding.yaml +++ b/examples/kamelets/hello-to-log-binding.yaml @@ -22,7 +22,7 @@ spec: source: ref: kind: Kamelet - apiVersion: camel.apache.org/v1alpha1 + apiVersion: camel.apache.org/v1 name: hello-source sink: uri: log:info diff --git a/examples/kamelets/kamelet-binding.feature b/examples/kamelets/kamelet-pipe.feature similarity index 50% rename from examples/kamelets/kamelet-binding.feature rename to examples/kamelets/kamelet-pipe.feature index b2c162f4..627c0302 100644 --- a/examples/kamelets/kamelet-binding.feature +++ b/examples/kamelets/kamelet-pipe.feature @@ -1,11 +1,4 @@ -Feature: Kamelet resource - - Background: - Given Disable auto removal of Kamelet resources - Given Disable auto removal of Kubernetes resources - Given Camel K resource polling configuration - | maxAttempts | 20 | - | delayBetweenAttempts | 1000 | +Feature: Kamelet pipe Scenario: Bind Kamelet to service # Create Kamelet from file @@ -14,24 +7,24 @@ Feature: Kamelet resource # Create the binding Given create Kubernetes service greeting-service with target port 8080 - And KameletBinding source properties + And Pipe source properties | message | Hello World | And bind Kamelet hello-source to uri http://greeting-service.${YAKS_NAMESPACE}/greeting - When create KameletBinding hello-source-uri - Then KameletBinding hello-source-uri should be available + When create Pipe hello-source-uri + Then Pipe hello-source-uri should be available # Verify binding Given HTTP server "greeting-service" And HTTP server timeout is 600000 ms - Then expect HTTP request body: Hello World + Then expect HTTP request body: Hello World! And receive POST /greeting Scenario: Create binding from YAML - Given load KameletBinding hello-to-log-binding.yaml - Then KameletBinding hello-to-log-binding should be available - And Camel K integration hello-to-log-binding should print Hello world! + Given load Pipe hello-to-log-binding.yaml + Then Pipe hello-to-log-binding should be available + And Camel K integration hello-to-log-binding should print Hello World! Scenario: Remove Camel K resources Given delete Kamelet hello-source - Given delete KameletBinding hello-source-uri - Given delete KameletBinding hello-to-log-binding + Given delete Pipe hello-source-uri + Given delete Pipe hello-to-log-binding diff --git a/examples/kamelets/kamelet-resource.feature b/examples/kamelets/kamelet-resource.feature index dcc957c5..1bd4a384 100644 --- a/examples/kamelets/kamelet-resource.feature +++ b/examples/kamelets/kamelet-resource.feature @@ -1,12 +1,5 @@ Feature: Kamelet resource - Background: - Given Disable auto removal of Camel K resources - Given Disable auto removal of Kamelet resources - Given Camel K resource polling configuration - | maxAttempts | 200 | - | delayBetweenAttempts | 1000 | - Scenario: Use Kamelet Given load Camel K integration timer-to-log.groovy Then Camel K integration timer-to-log should be running diff --git a/examples/kamelets/kamelet.feature b/examples/kamelets/kamelet.feature index 0740a042..0930a19b 100644 --- a/examples/kamelets/kamelet.feature +++ b/examples/kamelets/kamelet.feature @@ -1,12 +1,5 @@ Feature: Kamelet - Background: - Given Disable auto removal of Camel K resources - Given Disable auto removal of Kamelet resources - Given Camel K resource polling configuration - | maxAttempts | 200 | - | delayBetweenAttempts | 1000 | - Scenario: Create Kamelet Given Kamelet property definition | name | message | diff --git a/examples/kamelets/yaks-config.yaml b/examples/kamelets/yaks-config.yaml index 942b46af..1c23bad6 100644 --- a/examples/kamelets/yaks-config.yaml +++ b/examples/kamelets/yaks-config.yaml @@ -17,8 +17,14 @@ config: runtime: env: - - name: YAKS_KAMELET_API_VERSION - value: v1alpha1 + - name: YAKS_CAMELK_MAX_ATTEMPTS + value: 100 + - name: YAKS_CAMELK_DELAY_BETWEEN_ATTEMPTS + value: 1000 + - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES + value: false + - name: YAKS_KAMELETS_AUTO_REMOVE_RESOURCES + value: false settings: loggers: - name: INTEGRATION_STATUS