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 2021/07/16 17:25:33 UTC

[GitHub] [camel-k] lburgazzoli opened a new issue #2512: Issue when trying to configure env vars with annotations

lburgazzoli opened a new issue #2512:
URL: https://github.com/apache/camel-k/issues/2512


   I have a KameletBinding with some traits configured using environment vars:
   
   ```yaml
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     annotations:
       trait.camel.apache.org/environment.ENV_1: 1vPDOtAJ1gsUvwX1m3hjUJzDpIS
       trait.camel.apache.org/environment.ENV_2: 1vPDOsYNIlNc6mRrd0dNXPGhsDJ
   ```
   
   The generated integration fails with:
   
   ```
   Events:
     Type     Reason            Age                 From                            Message
     ----     ------            ----                ----                            -------
     Warning  IntegrationError  15s (x15 over 98s)  camel-k-integration-controller  Cannot reconcile Integration cf486b3dc88234900bcc75d838f0ef948: error during trait customization: 1 error(s) decoding:
   
   * '' has invalid keys: ENV_1, ENV_2
   ```
   


-- 
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] lburgazzoli commented on issue #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900944546


   @squakez yes you are right, I got confused by the description of the trait as it says:
   
       environment.[key]=[value]
   
   but then there's no reference to the key word in the table (it uses Properties) so I tough, that adding env vars would work. 
   
   BTW, I think it would be valuable to be able to set env vars using a trait instead of the configuration section. @nicolaferraro @astefanutti @squakez what do you think ?
   
   
   


-- 
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] lburgazzoli commented on issue #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900944546


   @squakez yes you are right, I got confused by the description of the trait as it says:
   
       environment.[key]=[value]
   
   but then there's no reference to the key word in the table (it uses Properties) so I tough, that adding env vars would work. 
   
   BTW, I think it would be valuable to be able to set env vars using a trait instead of the configuration section. @nicolaferraro @astefanutti @squakez what do you think ?
   
   
   


-- 
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 #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900945973


   I agree, we can probably move the `--env` logic into the `environment` trait.


-- 
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 #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez closed issue #2512:
URL: https://github.com/apache/camel-k/issues/2512


   


-- 
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 edited a comment on issue #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez edited a comment on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900937210


   According the [trait documentation](https://camel.apache.org/camel-k/latest/traits/environment.html), the trait is in charge to inject certain well known env variables, not to create any new one. The actual way to have it working would be to specify via `.spec.integration`, such as:
   ```
   metadata:
     name: timer-to-log
     namespace: default
   spec:
     integration:
       configuration:
       - type: env
         value: X=1
   ```
   Perhaps you're suggesting to enhance the trait to include the possibility to declare the `env` via annotation?


-- 
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 edited a comment on issue #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez edited a comment on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900937210


   According the [trait documentation](https://camel.apache.org/camel-k/latest/traits/environment.html), the trait is in charge to inject certain well known env variables, not to create any new one. The actual way to have it working would be to specify via `.spec.integration`, such as:
   ```
   metadata:
     name: timer-to-log
     namespace: default
   spec:
     integration:
       configuration:
       - type: env
         value: X=1
   ```
   Perhaps you're suggesting to enhance the trait to include the possibility to declare the `env` via annotation?


-- 
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 #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900937210


   According the [trait documentation](https://camel.apache.org/camel-k/latest/traits/environment.html), the trait is in charge to inject certain env variable, not to create any new one. The actual way to have it working would be to specify via `.spec.integration`, such as:
   ```
   metadata:
     name: timer-to-log
     namespace: default
   spec:
     integration:
       configuration:
       - type: env
         value: X=1
   ```
   Perhaps you're suggesting to enhance the trait to include the possibility to declare the `env` via annotation?


-- 
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 #2512: Issue when trying to configure env vars with annotations

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2512:
URL: https://github.com/apache/camel-k/issues/2512#issuecomment-900937210






-- 
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