You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "squakez (via GitHub)" <gi...@apache.org> on 2023/03/09 16:49:31 UTC

[GitHub] [camel-k] squakez opened a new issue, #4117: Kamelets are tried to unmarshal with old Flow

squakez opened a new issue, #4117:
URL: https://github.com/apache/camel-k/issues/4117

   ```
   $ kamel bind timer-source log-sink -p source.message=hello -n default -p source.period=1000 -p sink.showHeaders=true -o yaml > /tmp/klb.yaml
   squake:~/workspace/camel-k [feat/native_as_pod]$ kamel run /tmp/klb.yaml 
   Error: json: cannot unmarshal object into Go value of type []v1.Flow
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] nf3lix commented on issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "nf3lix (via GitHub)" <gi...@apache.org>.
nf3lix commented on issue #4117:
URL: https://github.com/apache/camel-k/issues/4117#issuecomment-1562854630

   Okay, thanks for the clarification. What I don't get then is how to apply traits to Integrations. In most cases this should be possible by providing the corresponding properties in the spec file (as stated here: https://camel.apache.org/camel-k/1.12.x/traits/traits.html). However, I see no possibility to do so for the pod trait, as it is applied by passing a pod template file in the Kamel CLI run-command.
   Example: `kamel run integration.groovy --pod-template template.yaml` (see [pod trait documentation](https://camel.apache.org/camel-k/1.12.x/traits/pod.html)). Is it possible to apply pod template file using kubectl? 
   
   Please let me know if I should open a new issue on that.
   Thank you for your support so far.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #4117:
URL: https://github.com/apache/camel-k/issues/4117#issuecomment-1562417339

   You cannot run an Integration via `kamel run` either. `kamel run` command is thought to work directly with a DSL such as Java, Yaml, etc. The CLI is in charge to do the parsing and transformation into an `Integration` for you. If you have an Integration type, then, the only way to run it is via `kubectl` (or `oc`) CLI like you're doing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #4117:
URL: https://github.com/apache/camel-k/issues/4117#issuecomment-1563045544

   The `pod-template` is a special case of a trait. It is really resolved into the Integration `spec.template.spec`. For example, `$ kamel run /tmp/Test.java --pod-template pod.yaml -o yaml` will turn into:
   
   ```
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     annotations:
       camel.apache.org/operator.id: camel-k
     creationTimestamp: null
     name: test
   spec:
     sources:
     - content: |
         // camel-k: language=java
   
         import org.apache.camel.builder.RouteBuilder;
   
         public class Test 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");
   
           }
         }
       name: Test.java
     template:
       spec:
         containers:
         - env:
           - name: TEST_VARIABLE
             value: hello from the template
           name: integration
           resources: {}
           volumeMounts:
           - mountPath: /var/log
             name: var-logs
         - command:
           - /bin/sh
           - -c
           - while true; do echo $(date -u) 'Content from the sidecar container' > /var/log/file.txt;
             sleep 1;done
           image: busybox
           name: sidecar
           resources: {}
           volumeMounts:
           - mountPath: /var/log
             name: var-logs
         securityContext: {}
         volumes:
         - emptyDir: {}
           name: var-logs
     traits: {}
   status: {}
   ```
   You can use `kamel run -o yaml` to verify how most of CLI will resolve into an Integration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez commented on issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #4117:
URL: https://github.com/apache/camel-k/issues/4117#issuecomment-1463723071

   Not a bug, we cannot run a binding via `kamel run`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] nf3lix commented on issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "nf3lix (via GitHub)" <gi...@apache.org>.
nf3lix commented on issue #4117:
URL: https://github.com/apache/camel-k/issues/4117#issuecomment-1562374666

   Hi @squakez 
   I'm facing the same issue when trying to run an Integration. 
   
   ```yaml
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     name: sample-route-1
   spec:
     flows:
       - route:
           id: route-a1ba
           from:
             uri: kamelet:timer-source
             id: from-8fbf
             parameters:
               message: hello world
               period: 5000
             steps:
               - log:
                   message: ${body}
                   id: log-d8d4
   ```
   When running `kamel run sample-route-1.yaml` I get the same error ("Error: json: cannot unmarshal object into Go value of type []v1.Flow"). Applying this integration with `kubectl apply -f sample-route-1.yaml` works fine.
   Is anyone able to reproduce that behavior?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-k] squakez closed issue #4117: Kamelets are tried to unmarshal with old Flow

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez closed issue #4117: Kamelets are tried to unmarshal with old Flow
URL: https://github.com/apache/camel-k/issues/4117


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org