Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--config property by kamel > 1.10: Errror spec.traits.mount.configuration: Required value #3923

Closed
OlegSkr opened this issue Dec 16, 2022 · 4 comments

Comments

@OlegSkr
Copy link

OlegSkr commented Dec 16, 2022

When trying to use "--config" property with kamel version > 1.10 it comes to following error in integration: "Error: Integration.camel.apache.org is invalid: spec.traits.mount.configuration: Required value"

user@rancher1:~/test$ ls -l
total 8
-rw-rw-r-- 1 user user  25 Dec 16 14:43 application.properties
-rw-rw-r-- 1 user user 128 Dec 16 14:42 test.yaml

user@rancher1:~/test$ cat test.yaml
- from:
    uri: direct:start
    steps:
      - set-body:
          simple: "Hello world!"
      - to:
          uri: log:info

user@rancher1:~/test$ cat application.properties
logging.level.root=DEBUG

user@rancher1:~/test$ kamel version
Camel K Client 1.10.3

user@rancher1:~/test$ kamel run --dev --config file:application.properties -n camel-k-110 test.yaml
Integration "test" created
Error: Integration.camel.apache.org "test" is invalid: spec.traits.mount.configuration: Required value

user@rancher1:~/test$ kamel run --config file:application.properties test.yaml  -n camel-k-110 -o yaml | tail
      - set-body:
          simple: Hello world!
      - to:
          uri: log:info
      uri: direct:start
  traits:
    mount:
      configs:
      - configmap:cm-2e138a524b3aa931f30ed2b1c525fef032fd617d/application.properties@/etc/camel/conf.d/_resources/application.properties
status: {}
user@rancher1:~/test$ ~/kamel-1.8.2/kamel run --config file:application.properties test.yaml  -n camel-k-110 -o yaml | tail
You're using Camel K 1.8.2 client with a 1.10.3 cluster operator, it's recommended to use the same version to improve compatibility.

          simple: Hello world!
      - to:
          uri: log:info
      uri: direct:start
  traits:
    mount:
      configuration:
        configs:
        - configmap:cm-2e138a524b3aa931f30ed2b1c525fef032fd617d/application.properties@/etc/camel/conf.d/_resources/application.properties
status: {}

Workaround is to output the integration into yaml file, move "configs" array under "spec.traits.mount.configuration" and do "kubectl apply"

@squakez
Copy link
Contributor

squakez commented Dec 16, 2022

I think the problem could be that the newer version of Camel doesn't like any other application.properties in the classpath (we create one by default). If you change the name of your --config to anything else, you see it will work. What I think it can happen when it seems to work with 1.8.3 CLI is that, since it moves the configuration to a place that is not expected, it is simply ignored by the operator.

@oscerd do you recall any change on Camel framework that may lead to this?

@squakez squakez added the status/waiting-for-feedback Needs some feedback label Dec 16, 2022
@oscerd
Copy link
Contributor

oscerd commented Dec 16, 2022

Not really, maybe @davsclaus has some clues

@OlegSkr
Copy link
Author

OlegSkr commented Dec 17, 2022

@squakez the name of the file doesn't matter

It happens with anything added through --config or --resource, and no matter whether it is "file", or "configmap".

user@rancher1:~/test$ mv application.properties anything.else

user@rancher1:~/test$ kamel run --dev --config file:anything.else -n camel-k-110 test.yaml
Integration "test" created
Error: Integration.camel.apache.org "test" is invalid: spec.traits.mount.configuration: Required value

user@rancher1:~/test$ kamel run --config file:anything.else -n camel-k-110 test.yaml -o yaml | tail
      - set-body:
          simple: Hello world!
      - to:
          uri: log:info
      uri: direct:start
  traits:
    mount:
      configs:
      - configmap:cm-3e2f97c66ad51802240d16a50e642a38cb40a196/anything.else@/etc/camel/conf.d/_resources/anything.else
status: {}

user@rancher1:~/test$ kamel run --resource file:anything.else -n camel-k-110 test.yaml -o yaml | tail
      - set-body:
          simple: Hello world!
      - to:
          uri: log:info
      uri: direct:start
  traits:
    mount:
      resources:
      - configmap:cm-3e2f97c66ad51802240d16a50e642a38cb40a196/anything.else@/etc/camel/resources/anything.else
status: {}

@squakez
Copy link
Contributor

squakez commented Dec 19, 2022

I cannot reproduce the issue. I've tested both on 1.11.0 and 1.10.3 version and it seems to work correctly. According to the error message I have the feeling you CRDs are not up to date. I can suggest to kamel uninstall --all (in order to wipe it off also the CRDs) and reinstall a new version of the operator and retry.

Also, there is no apparent problem when using application.properties. Just tested with that file name successfully as well.

@squakez squakez removed the status/waiting-for-feedback Needs some feedback label Dec 19, 2022
@squakez squakez closed this as completed Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants