Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-20695

Parameter template of kamelet jslt-action fails to find file in non-current directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Undefined Undefined
    • None
    • camel-k-1.10
    • Camel-K
    • None
    • False
    • None
    • False
    • % %
    • Todo
    • Very Likely

      On OCP 4.11, with Camel K 1.10.0CK5, I observe following problem in kameletbinding with jslt-action, if parameter template points to "file:":
      1. in case template points to file in current directory, integration runs correctly
      2. otherwise the file seems to be searched for in pod of created integration (ie. if I use either relative or absolute path to the transformation file on my drive)

      Ad 2. - As a workaround I created configmap and mounted it via trait mount.resources in the kameletbinding; it was created in the integration pod in default location /etc/camel/resources/, so I could specify in template parameter path 'file:///etc/camel/resources/myconfigmap/jslt':

          apiVersion: camel.apache.org/v1alpha1
          kind: KameletBinding
          metadata:
            annotations:
              trait.camel.apache.org/mount.resources: 'configmap:myconfigmap'
            name: jslt-kbind
          spec:
            source:
              ref:
                kind: Kamelet
                apiVersion: camel.apache.org/v1alpha1
                name: timer-source
              properties:
                message: '{"from":{ "first_name":"MyCamelBot"},"text":"third msg"}'
            steps:
            - ref:
                kind: Kamelet
                apiVersion: camel.apache.org/v1alpha1
                name: jslt-action
              properties:
                #template: file://myfile.jslt # OK - file in current directory
                #template: file://mylocaldir/myfile.jslt #NOK - file doesn't exist
                #template: file://./mylocaldir/myfile.jslt #NOK 
                #template: file:///tmp/mylocaldir/myfile.jslt #NOK
                template: 'file:///etc/camel/resources/myconfigmap/jslt'
            sink:
              ref:
                kind: Kamelet
                apiVersion: camel.apache.org/v1alpha1
                name: log-sink
      
      $ oc get cm myconfigmap -o yaml
      apiVersion: v1
      data:
        jslt: .foo
      kind: ConfigMap
      metadata:
        name: myconfigmap
      

            Unassigned Unassigned
            lfabriko@redhat.com Lucie Krejcirova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: