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

gfournier pushed a commit to branch release-2.3.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-2.3.x by this push:
     new c7cb9d548 fix(kamelet): Data type action kamelet transformer error
c7cb9d548 is described below

commit c7cb9d548114161e159da7928e1d6d7455c6dd7c
Author: Gaelle Fournier <[email protected]>
AuthorDate: Mon May 27 15:17:42 2024 +0200

    fix(kamelet): Data type action kamelet transformer error
    
    * remove default data-type-action kamelet in e2e yaks test
    * rewrite the test to use correct formats
---
 .../data-type-action.kamelet.yaml                  | 70 ----------------------
 .../common/kamelet-data-types/event-binding.yaml   |  4 +-
 .../kamelet-data-types/event-sink.kamelet.yaml     |  4 +-
 .../kamelet-data-types/event-source.kamelet.yaml   |  4 +-
 .../common/kamelet-data-types/timer-to-log.yaml    |  4 +-
 .../common/kamelet-data-types/yaks-config.yaml     |  1 -
 6 files changed, 10 insertions(+), 77 deletions(-)

diff --git a/e2e/yaks/common/kamelet-data-types/data-type-action.kamelet.yaml 
b/e2e/yaks/common/kamelet-data-types/data-type-action.kamelet.yaml
deleted file mode 100644
index 230a5e931..000000000
--- a/e2e/yaks/common/kamelet-data-types/data-type-action.kamelet.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-apiVersion: camel.apache.org/v1
-kind: Kamelet
-metadata:
-  name: data-type-action
-  annotations:
-    camel.apache.org/kamelet.support.level: "Stable"
-    camel.apache.org/catalog.version: "main-SNAPSHOT"
-    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG
 [...]
-    camel.apache.org/provider: "Apache Software Foundation"
-    camel.apache.org/kamelet.group: "Actions"
-    camel.apache.org/kamelet.namespace: "Transformation"
-  labels:
-    camel.apache.org/kamelet.type: "action"
-spec:
-  definition:
-    title: "Data Type Action"
-    description: |-
-      Applies a given data type with respective data transformation.
-    required:
-      - format
-    type: object
-    properties:
-      scheme:
-        title: Component Scheme
-        description: The data type component scheme enables users to apply 
Camel component specific data type conversions.
-        type: string
-        default: "camel"
-        example: "camel"
-      format:
-        title: Data Type Format
-        description: Defines the data type that will be applied by this 
action. The Kamelet catalog supports different data types and performs 
automatic message conversion according to the given type.
-        type: string
-  dependencies:
-    - "mvn:org.apache.camel.kamelets:camel-kamelets-utils:3.20.1"
-    - "camel:kamelet"
-    - "camel:core"
-  template:
-    beans:
-      - name: dataTypeRegistry
-        type: 
"#class:org.apache.camel.kamelets.utils.format.DefaultDataTypeRegistry"
-      - name: dataTypeProcessor
-        type: "#class:org.apache.camel.kamelets.utils.format.DataTypeProcessor"
-        property:
-          - key: scheme
-            value: '{{scheme}}'
-          - key: format
-            value: '{{format}}'
-          - key: registry
-            value: '#bean:{{dataTypeRegistry}}'
-    from:
-      uri: "kamelet:source"
-      steps:
-      - process:
-          ref: "{{dataTypeProcessor}}"
diff --git a/e2e/yaks/common/kamelet-data-types/event-binding.yaml 
b/e2e/yaks/common/kamelet-data-types/event-binding.yaml
index 17f3079c9..aa19af846 100644
--- a/e2e/yaks/common/kamelet-data-types/event-binding.yaml
+++ b/e2e/yaks/common/kamelet-data-types/event-binding.yaml
@@ -27,7 +27,7 @@ spec:
       name: event-source
     dataTypes:
       out:
-        format: binary
+        format: "application-octet-stream"
   steps:
     - ref:
         kind: Kamelet
@@ -40,4 +40,4 @@ spec:
       name: event-sink
     dataTypes:
       in:
-        format: string
+        format: "text-plain"
\ No newline at end of file
diff --git a/e2e/yaks/common/kamelet-data-types/event-sink.kamelet.yaml 
b/e2e/yaks/common/kamelet-data-types/event-sink.kamelet.yaml
index c6967ce51..831b5a4ae 100644
--- a/e2e/yaks/common/kamelet-data-types/event-sink.kamelet.yaml
+++ b/e2e/yaks/common/kamelet-data-types/event-sink.kamelet.yaml
@@ -30,8 +30,10 @@ spec:
       default: string
       types:
         string:
-          mediaType: plain/text
+          format: "text-plain"
+          mediaType: text/plain
         binary:
+          format: "application-octet-stream"
           mediaType: application/octet-stream
   dependencies:
     - "camel:core"
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 20993c006..e43f931fe 100644
--- a/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml
+++ b/e2e/yaks/common/kamelet-data-types/event-source.kamelet.yaml
@@ -30,8 +30,10 @@ spec:
       default: string
       types:
         string:
-          mediaType: plain/text
+          format: "text-plain"
+          mediaType: text/plain
         binary:
+          format: "application-octet-stream"
           mediaType: application/octet-stream
   dependencies:
     - "camel:core"
diff --git a/e2e/yaks/common/kamelet-data-types/timer-to-log.yaml 
b/e2e/yaks/common/kamelet-data-types/timer-to-log.yaml
index 38c258480..4f8b026d6 100644
--- a/e2e/yaks/common/kamelet-data-types/timer-to-log.yaml
+++ b/e2e/yaks/common/kamelet-data-types/timer-to-log.yaml
@@ -34,9 +34,9 @@ spec:
         name: log-action
       dataTypes:
         in:
-          format: binary
+          format: "application-octet-stream"
         out:
-          format: string
+          format: "text-plain"
   sink:
     ref:
       kind: Kamelet
diff --git a/e2e/yaks/common/kamelet-data-types/yaks-config.yaml 
b/e2e/yaks/common/kamelet-data-types/yaks-config.yaml
index 768f70568..74f69461d 100644
--- a/e2e/yaks/common/kamelet-data-types/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet-data-types/yaks-config.yaml
@@ -36,7 +36,6 @@ pre:
   run: |
     kubectl apply -f event-source.kamelet.yaml -n $YAKS_NAMESPACE
     kubectl apply -f event-sink.kamelet.yaml -n $YAKS_NAMESPACE
-    kubectl apply -f data-type-action.kamelet.yaml -n $YAKS_NAMESPACE
 post:
   - name: print dump
     if: env:CI=true && failure()

Reply via email to