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-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to