You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/04/08 14:52:06 UTC

[GitHub] [camel-k] lburgazzoli opened a new pull request #1400: Add some sugar for additional sources

lburgazzoli opened a new pull request #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400
 
 
   Fixes #1388
   
   
   <!-- Description -->
   
   
   
   
   <!--
   Enter your extended release note in the below block. If the PR requires
   additional action from users switching to the new release, include the string
   "action required". If no release note is required, write "NONE". 
   
   You can (optionally) mark this PR with labels "kind/bug" or "kind/feature" to make sure
   the text is added to the right section of the release notes. 
   -->
   
   **Release Note**
   ```release-note
   NONE
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro edited a comment on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro edited a comment on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613448136
 
 
   > Also, running:
   > 
   > ```
   > kamel run examples/simple.groovy --source examples/Master.java --source examples/petstore.groovy --save
   > ```
   > 
   > (it doesn't make sense to run those integrations together, it's just for testing)
   > 
   > Followed by:
   > 
   > ```
   > kamel run examples/simple.groovy
   > ```
   > 
   > Should take to the same result, but configuration is not loaded in the second case.
   
   It's not specifically related to `--source`, also other flags are not loaded.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613958339
 
 
   We should add some it tests btw

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613929693
 
 
   @nicolaferraro  mind testing it again ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro edited a comment on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro edited a comment on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615504396
 
 
   Mmh... save is not additive, while execution is:
   
   ```
   kamel run examples/simple.groovy --source examples/Master.java  --save
   ```
   
   Now in config you have:
   
   ```
   kamel:
     run:
       integration:
         simple:
           sources:
           - examples/Master.java
   
   ```
   
   Now you want to add a dependency:
   
   ```
   kamel run examples/simple.groovy -d camel-log  --save
   ```
   
   But what you have now in config is:
   ```
   kamel:
     run:
       integration:
         simple:
           dependencies:
           - camel-log
   ```
   
   I.e. the master integration is deleted. It's a choice, that is different from the current behavior.
   
   But the problem is that now the integration contains both sources (simple and Master).
   And if you run again `kamel run examples/simple.groovy` the Master source disappears.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615504396
 
 
   Mmh... save is not additive, while execution is:
   
   ```
   kamel run examples/simple.groovy --source examples/Master.java  --save
   ```
   
   Now in config you have:
   
   ```
   kamel:
     run:
       integration:
         simple:
           sources:
           - examples/Master.java
   
   ```
   
   Now you want to add a dependency:
   
   ```
   kamel run examples/simple.groovy -d camel-log  --save
   ```
   
   But what you have now in config is:
   ```
   kamel:
     run:
       integration:
         simple:
           dependencies:
           - camel-log
   ```
   
   I.e. the master integration is deleted. It's a choice, that is different from the current behavior.
   
   But a related problem is that now the integration contains both sources (simple and Master).
   And if you run again `kamel run examples/simple.groovy` the Master source disappears.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615427264
 
 
   so I've added a huge hack, please test it again

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613995083
 
 
   @nicolaferraro should finally work now

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613448136
 
 
   > Also, running:
   > 
   > ```
   > kamel run examples/simple.groovy --source examples/Master.java --source examples/petstore.groovy --save
   > ```
   > 
   > (it doesn't make sense to run those integrations together, it's just for testing)
   > 
   > Followed by:
   > 
   > ```
   > kamel run examples/simple.groovy
   > ```
   > 
   > Should take to the same result, but configuration is not loaded in the second case.
   
   It's not specifically related to `--sources`, also other flags are not loaded.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615851878
 
 
   OK now it should be additive.
   
   I'll revisit the whole cmd stuff after 1.0

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615318215
 
 
   No way to override/change what it's in the kamel-config.yaml:
   
   ```
   kamel run examples/simple.groovy --source examples/petstore.groovy --save
   kamel run examples/simple.groovy --source examples/Master.java
   # Still runs the first combination, ignoring Master
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613962527
 
 
   > We should add some it tests btw
   
   there is a test but may cause the failure of other tests as we use a global viper so I disabled it

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] lburgazzoli commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615348920
 
 
   > No way to override/change what it's in the kamel-config.yaml:
   > 
   > ```
   > kamel run examples/simple.groovy --source examples/petstore.groovy --save
   > kamel run examples/simple.groovy --source examples/Master.java
   > # Still runs the first combination, ignoring Master
   > ```
   
   This is a little bit tricky and not sure if it is related to this PR as in fact when the run command runs, it performs two steps:
   
   1. load from kamel.run
   2. load from kamel.run.integration.$name
   
   the second step is of course not bounded to any flag as it is dynamic so any flag value gets overridden by the value from the persisted configuration.
   
   let me think about what I can do
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-615857764
 
 
   Looks good enough..
   The only strange behavior is that it's not additive when managing lists, but it's not a huge problem.
   
   I mean:
   
   ```
   kamel run xxx.groovy --source yyy.groovy --save
   # config contains source yyy
   kamel run xxx.groovy -d camel-telegram --save
   # config contains source yyy and dependency camel-telegram
   kamel run xxx.groovy -d camel-class --save
   # config contains source yyy and dependency camel-class (camel-telegram has gone)
   ```
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613958110
 
 
   > @nicolaferraro mind testing it again ?
   
   Still not loading
   
   ```
   [nferraro@localhost camel-k]$ kamel run examples/hello.xml -t quarkus.enabled=true --save
   integration "hello" created
   [nferraro@localhost camel-k]$ kubectl get it hello -o yaml | grep quarkus
       quarkus:
     - camel-quarkus:core
     - camel-quarkus:log
     - camel-quarkus:timer
     - mvn:org.apache.camel.k/camel-k-quarkus-loader-xml
     - mvn:org.apache.camel.k/camel-k-runtime-quarkus
     runtimeProvider: quarkus
   [nferraro@localhost camel-k]$ kamel delete --all
   1 integration(s) deleted
   [nferraro@localhost camel-k]$ kamel run examples/hello.xml
   integration "hello" created
   [nferraro@localhost camel-k]$ kubectl get it hello -o yaml | grep quarkus
   [nferraro@localhost camel-k]$ echo "saved but not loaded"
   saved but not loaded
   
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-k] nicolaferraro commented on issue #1400: Add some sugar for additional sources

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1400: Add some sugar for additional sources
URL: https://github.com/apache/camel-k/pull/1400#issuecomment-613446893
 
 
   Also, running:
   ```
   kamel run examples/simple.groovy --source examples/Master.java --source examples/petstore.groovy --save
   ```
   (it doesn't make sense to run those integrations together, it's just for testing)
   
   Followed by:
   ```
   kamel run examples/simple.groovy
   ```
   
   Should take to the same result, but configuration is not loaded in the second case.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services