Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-21336

camel-kamelet - Allow Kamelets configured by EnvVars only

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.8.0
    • 4.8.1, 4.9.0
    • camel-kamelet
    • None
    • Unknown

    Description

      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:

      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 

      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.

      Attachments

        Issue Links

          Activity

            People

              christophd Christoph Deppisch
              christophd Christoph Deppisch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: