Skip to content

Commit

Permalink
Wrong knative dependency #1337
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Mar 12, 2020
1 parent f73e30c commit 74db1a6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pkg/apis/camel/v1/camelcatalog_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 74db1a6

Please sign in to comment.