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/12/15 03:16:42 UTC
[GitHub] [camel-k] tadayosi commented on a diff in pull request #3901: fix(#3896): Fix dependency inspector supporting property placeholders
tadayosi commented on code in PR #3901:
URL: https://github.com/apache/camel-k/pull/3901#discussion_r1049174496
##########
pkg/util/source/inspector.go:
##########
@@ -336,6 +336,11 @@ func (i *baseInspector) discoverKamelets(meta *Metadata) {
}
func (i *baseInspector) addDependencies(uri string, meta *Metadata, consumer bool) error {
+ if !strings.Contains(uri, ":") {
+ // given URI is not in required format (maybe using a property placeholder such as {{url}})
+ return nil
+ }
+
candidateComp, scheme := i.catalog.DecodeComponent(uri)
if candidateComp == nil || scheme == nil {
Review Comment:
here
##########
pkg/util/source/inspector.go:
##########
@@ -336,6 +336,11 @@ func (i *baseInspector) discoverKamelets(meta *Metadata) {
}
func (i *baseInspector) addDependencies(uri string, meta *Metadata, consumer bool) error {
+ if !strings.Contains(uri, ":") {
Review Comment:
As Pasquale already pointed out, it appeares this check should be smarter. Example:
https://github.com/apache/camel-kamelets/blob/main/kamelets/elasticsearch-search-source.kamelet.yaml#L110
My suggestion would be, instead of checking the uri at the beginning of this func, what about examining the `scheme` and `candidateComp` values inside the block at line 345 after calling `DecodeComponent()` method?
--
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