This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/master by this push:
     new ef1be0f  Wrong knative dependency #1337
ef1be0f is described below

commit ef1be0f8cfde1c8dc204f8f951123e1186027276
Author: lburgazzoli <lburgazz...@gmail.com>
AuthorDate: Thu Mar 12 11:56:22 2020 +0100

    Wrong knative dependency #1337
---
 pkg/apis/camel/v1/camelcatalog_types_support.go | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go 
b/pkg/apis/camel/v1/camelcatalog_types_support.go
index edda60f..83fcc68 100644
--- a/pkg/apis/camel/v1/camelcatalog_types_support.go
+++ b/pkg/apis/camel/v1/camelcatalog_types_support.go
@@ -63,13 +63,15 @@ func NewCamelCatalogList() CamelCatalogList {
 }
 
 // GetDependencyID returns a Camel K recognizable maven dependency for the 
artifact
-func (a CamelArtifact) GetDependencyID() string {
-       artifactID := a.ArtifactID
-       if a.GroupID == "org.apache.camel" && strings.HasPrefix(artifactID, 
"camel-") {
-               return "camel:" + artifactID[6:]
+func (in *CamelArtifact) GetDependencyID() string {
+       switch {
+       case in.GroupID == "org.apache.camel" && 
strings.HasPrefix(in.ArtifactID, "camel-"):
+               return "camel:" + in.ArtifactID[6:]
+       case in.GroupID == "org.apache.camel.quarkus" && 
strings.HasPrefix(in.ArtifactID, "camel-quarkus-"):
+               return "camel-quarkus:" + in.ArtifactID[14:]
+       case in.Version == "":
+               return "mvn:" + in.GroupID + ":" + in.ArtifactID
+       default:
+               return "mvn:" + in.GroupID + ":" + in.ArtifactID + ":" + 
in.Version
        }
-       if a.GroupID == "org.apache.camel.quarkus" && 
strings.HasPrefix(artifactID, "camel-quarkus-") {
-               return "camel-quarkus:" + artifactID[14:]
-       }
-       return "mvn:" + a.GroupID + ":" + artifactID + ":" + a.Version
 }

Reply via email to