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 2022/07/19 08:09:54 UTC
[GitHub] [camel-k] oscerd opened a new issue, #3458: Declaring multiple traits in KameletBinding fails badly
oscerd opened a new issue, #3458:
URL: https://github.com/apache/camel-k/issues/3458
If you try something like:
```
apiVersion: [camel.apache.org/v1alpha1](https://camel.apache.org/v1alpha1)
kind: KameletBinding
metadata:
name: test
spec:
integration:
traits:
camel:
configuration:
properties:
- "camel.aws.vault.accessKey=access"
- "camel.aws.vault.secretKey=secret"
- "camel.aws.vault.region=region"
builder:
configuration:
properties:
- "quarkus.camel.service.discovery.include-patterns=META-INF/services/org/apache/camel/properties-function/*"
source:
ref:
kind: Kamelet
apiVersion: [camel.apache.org/v1alpha1](https://camel.apache.org/v1alpha1)
name: timer-source
properties:
period: "5000"
message: '"Invocation"'
steps:
- ref:
kind: Kamelet
apiVersion: [camel.apache.org/v1alpha1](https://camel.apache.org/v1alpha1)
name: http-sink
properties:
url: "https://finnhub.io/api/v1/quote?symbol=AAPL&token={{aws:finnhub-token}}"
sink:
ref:
kind: Kamelet
apiVersion: [camel.apache.org/v1alpha1](https://camel.apache.org/v1alpha1)
name: log-sink
```
This will fail with:
`{"level":"error","ts":1658164253.419387,"logger":"controller.integration-controller","msg":"Reconciler error","reconciler group":"camel.apache.org","reconciler kind":"Integration","name":"test","namespace":"default","error":"error executing post actions: error during apply resource: default/test: failed to create typed patch object (default/test; apps/v1, Kind=Deployment): errors:\n .spec.template.spec.containers[name=\"integration\"].volumeMounts: duplicate entries for key [mountPath=\"/etc/camel/conf.d/user.properties\"]\n .spec.template.spec.volumes: duplicate entries for key [name=\"user-properties\"]","errorVerbose":"error during apply resource: default/test: failed to create typed patch object (default/test; apps/v1, Kind=Deployment): errors:\n .spec.template.spec.containers[name=\"integration\"].volumeMounts: duplicate entries for key [mountPath=\"/etc/camel/conf.d/user.properties\"]\n .spec.template.spec.volumes: duplicate entries for key [name=\"user-properties\"]\ne
rror executing post actions\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:55\ngithub.com/apache/camel-k/pkg/controller/integration.(*monitorAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/monitor.go:118\ngithub.com/apache/camel-k/pkg/controller/integration.(*reconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:309\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller
).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:227\nruntime.goexit\n\truntime/asm_amd64.s:1371","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:227"}
`
I don't know if the declaration is wrong, but I prefer open an issue to track.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] oscerd commented on issue #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
oscerd commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188851532
Ok, it needs to be escaped. Let's see if it works or not.
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez closed issue #3458: Declaring multiple traits in KameletBinding fails badly
URL: https://github.com/apache/camel-k/issues/3458
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188855724
Marking it as a bug, it may be an issue in the camel trait as I see it tries to mount several times the same volume.
--
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] oscerd commented on issue #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
oscerd commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188853354
Same error
`{"level":"error","ts":1658224752.5068548,"logger":"controller.integration-controller","msg":"Reconciler error","reconciler group":"camel.apache.org","reconciler kind":"Integration","name":"daje-101","namespace":"default","error":"error executing post actions: error during apply resource: default/daje-101: failed to create typed patch object (default/daje-101; apps/v1, Kind=Deployment): errors:\n .spec.template.spec.containers[name=\"integration\"].volumeMounts: duplicate entries for key [mountPath=\"/etc/camel/conf.d/user.properties\"]\n .spec.template.spec.volumes: duplicate entries for key [name=\"user-properties\"]","errorVerbose":"error during apply resource: default/daje-101: failed to create typed patch object (default/daje-101; apps/v1, Kind=Deployment): errors:\n .spec.template.spec.containers[name=\"integration\"].volumeMounts: duplicate entries for key [mountPath=\"/etc/camel/conf.d/user.properties\"]\n .spec.template.spec.volumes: duplicate entries for key [name=\"
user-properties\"]\nerror executing post actions\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:55\ngithub.com/apache/camel-k/pkg/controller/integration.(*monitorAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/monitor.go:118\ngithub.com/apache/camel-k/pkg/controller/integration.(*reconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:309\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/co
ntroller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:227\nruntime.goexit\n\truntime/asm_amd64.s:1371","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.10.3/pkg/internal/controller/controller.go:227"}`
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1195537689
It seems the problem is happening when there is both a `camel.properties` trait enabled and a Kamelet property configured. Probably we're trying to mount twice the same `user.properties` instead of merging them into one unique (or 2 property file with different name).
--
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] oscerd commented on issue #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
oscerd commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188875008
It's not really critical at this time, but supporting vault for loading properties, means being able to essentially inject either camel properties or env variables and adding the camel component JAR for the vaults used.. I think this should be possible in all the way we are offering and for the moment it seems to be working only through Kamel run.
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188857608
As a temporary workaround you can use the deprecated `.spec.configuration` property: https://github.com/apache/camel-k/blob/main/pkg/apis/camel/v1/integration_types.go#L79
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188809506
Yeah, I think the problem is the declaration, as the format expected may be this one:
> if you need to specify an array of values, the syntax will be trait.camel.apache.org/trait.conf: "[\"opt1\", \"opt2\", …]"
from https://camel.apache.org/camel-k/1.9.x/kamelets/kamelets-user.html#_trait_via_annotations
please, try that and let us know how it goes.
--
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] oscerd commented on issue #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
oscerd commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188848321
If I go with
```
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: daje-101
annotations:
trait.camel.apache.org/camel.properties: ["camel.aws.vault.accessKey=xxxx","camel.aws.vault.secretKey=yyyy","camel.aws.vault.region=region"]
trait.camel.apache.org/builder.properties: ["quarkus.camel.service.discovery.include-patterns=META-INF/services/org/apache/camel/properties-function/*"]
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timer-source
properties:
period: "5000"
message: '"Invocation"'
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: http-sink
properties:
url: "https://finnhub.io/api/v1/quote?symbol=AAPL&token={{aws:finnhub-token}}"
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: log-sink
```
This will fail with
`error validating data: [ValidationError(KameletBinding.metadata.annotations.trait.camel.apache.org/builder.properties): invalid type for io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta_v2.annotations: got "array", expected "string", ValidationError(KameletBinding.metadata.annotations.trait.camel.apache.org/camel.properties): invalid type for io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta_v2.annotations: got "array", expected "string"]; if you choose to ignore these errors, turn validation off with --validate=false`
--
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 #3458: Declaring multiple traits in KameletBinding fails badly
Posted by GitBox <gi...@apache.org>.
squakez commented on issue #3458:
URL: https://github.com/apache/camel-k/issues/3458#issuecomment-1188811197
Just noticing that one would be for annotations. Probably it is anyhow the preferred way to add traits to KameletBindings.
--
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