You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Christoph Deppisch (Jira)" <ji...@apache.org> on 2024/10/10 09:18:00 UTC

[jira] [Created] (CAMEL-21336) Allow Kamelets configured by EnvVars only

Christoph Deppisch created CAMEL-21336:
------------------------------------------

             Summary: Allow Kamelets configured by EnvVars only
                 Key: CAMEL-21336
                 URL: https://issues.apache.org/jira/browse/CAMEL-21336
             Project: Camel
          Issue Type: Bug
          Components: camel-kamelet
    Affects Versions: 4.8.0
            Reporter: Christoph Deppisch


Kamelets may be configured via environment variables following the property component syntax like CAMEL_KAMELET_AWS_S3_SOURCE_BUCKET_NAME_OR_ARN=myArn

Apparently the Kamelet property validation for required parameters raises exceptions when initializing the Kamelet. This is because the config properties configured via environment variables are not considered in the validation process.

The raised exception looks like this:
{noformat}
s3-sink-deployment-7886f69cc-khspt sink Caused by: java.lang.IllegalArgumentException: Route template aws-s3-sink the following mandatory parameters must be provided: bucketNameOrArn, region
s3-sink-deployment-7886f69cc-khspt sink 	at org.apache.camel.impl.DefaultModel.addRouteFromTemplate(DefaultModel.java:477)
s3-sink-deployment-7886f69cc-khspt sink 	at org.apache.camel.impl.DefaultModel.addRouteFromTemplate(DefaultModel.java:416)
s3-sink-deployment-7886f69cc-khspt sink 	at org.apache.camel.impl.DefaultCamelContext.addRouteFromTemplate(DefaultCamelContext.java:362)
s3-sink-deployment-7886f69cc-khspt sink 	at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.createRouteForEndpoint(KameletComponent.java:433)
s3-sink-deployment-7886f69cc-khspt sink 	... 28 more
s3-sink-deployment-7886f69cc-khspt sink {noformat}
As a workaround users need to set an empty Kamelet property value e.g.g via application.properties to pass the Kamelet validation and then overwrite the value with the environment variable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)