You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/01/29 17:24:55 UTC

[camel-k] branch master updated: Fix #1939: workaround for catalogs with duplicate entries

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

astefanutti 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 c247cd8  Fix #1939: workaround for catalogs with duplicate entries
c247cd8 is described below

commit c247cd86f19d4310e66505f3ebdecbfc5aca0465
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Fri Jan 29 17:00:42 2021 +0100

    Fix #1939: workaround for catalogs with duplicate entries
---
 pkg/util/camel/camel_runtime_catalog.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pkg/util/camel/camel_runtime_catalog.go b/pkg/util/camel/camel_runtime_catalog.go
index 2482eff..dc71a40 100644
--- a/pkg/util/camel/camel_runtime_catalog.go
+++ b/pkg/util/camel/camel_runtime_catalog.go
@@ -36,6 +36,15 @@ func NewRuntimeCatalog(spec v1.CamelCatalogSpec) *RuntimeCatalog {
 	for id, artifact := range catalog.Artifacts {
 		for _, scheme := range artifact.Schemes {
 			scheme := scheme
+
+			// In case of duplicate only, choose the "org.apache.camel.quarkus" artifact (if present).
+			// Workaround for https://github.com/apache/camel-k-runtime/issues/592
+			if _, duplicate := catalog.artifactByScheme[scheme.ID]; duplicate {
+				if artifact.GroupID != "org.apache.camel.quarkus" {
+					continue
+				}
+			}
+
 			catalog.artifactByScheme[scheme.ID] = id
 			catalog.schemesByID[scheme.ID] = scheme
 		}