You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/04/29 05:36:50 UTC

[camel-kamelets] branch main updated (120736c -> 6a3d31c)

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

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git.


    from 120736c  Camel-Kamelets-Catalog: Parent should point to org.apache apache
     new e28ca4a  Camel-Kamelets-Catalog: Added constants for labels
     new 6a3d31c  Camel-Kamelets-Catalog: Aligned tests to labels constants

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/kamelets/catalog/KameletsCatalog.java   |  5 +++--
 .../{KameletTypeEnum.java => KameletLabelNames.java}     | 16 ++++------------
 2 files changed, 7 insertions(+), 14 deletions(-)
 copy camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/model/{KameletTypeEnum.java => KameletLabelNames.java} (78%)

[camel-kamelets] 02/02: Camel-Kamelets-Catalog: Aligned tests to labels constants

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 6a3d31cce24463daa5d052c849064cffff788e48
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 29 07:35:58 2021 +0200

    Camel-Kamelets-Catalog: Aligned tests to labels constants
---
 .../main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
index d28e2d4..2789435 100644
--- a/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
+++ b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
 import io.fabric8.camelk.v1alpha1.Kamelet;
 import io.fabric8.kubernetes.api.model.apiextensions.v1.JSONSchemaProps;
+import org.apache.camel.kamelets.catalog.model.KameletLabelNames;
 import org.apache.commons.io.Charsets;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
@@ -87,7 +88,7 @@ public class KameletsCatalog {
 
     public List<Kamelet> getKameletsByType(String type) {
         List<Kamelet> collect = kameletModels.entrySet().stream()
-                .filter(x -> x.getValue().getMetadata().getLabels().get("camel.apache.org/kamelet.type").contains(type))
+                .filter(x -> x.getValue().getMetadata().getLabels().get(KameletLabelNames.KAMELET_LABEL_TYPE).contains(type))
                 .map(Map.Entry::getValue)
                 .collect(Collectors.toList());
         return collect;
@@ -104,7 +105,7 @@ public class KameletsCatalog {
 
     public List<Kamelet> getKameletByProvider(String provider) {
         List<Kamelet> collect = kameletModels.entrySet().stream()
-                .filter(x -> x.getValue().getMetadata().getAnnotations().get("camel.apache.org/provider").equalsIgnoreCase(provider))
+                .filter(x -> x.getValue().getMetadata().getAnnotations().get(KameletLabelNames.KAMELET_LABEL_PROVIDER).equalsIgnoreCase(provider))
                 .map(Map.Entry::getValue)
                 .collect(Collectors.toList());
         if (!collect.isEmpty()) {

[camel-kamelets] 01/02: Camel-Kamelets-Catalog: Added constants for labels

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit e28ca4aaee4099029e8ac43cd13e342fd833eaee
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 29 07:34:56 2021 +0200

    Camel-Kamelets-Catalog: Added constants for labels
---
 .../kamelets/catalog/model/KameletLabelNames.java  | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/model/KameletLabelNames.java b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/model/KameletLabelNames.java
new file mode 100644
index 0000000..4fc811b
--- /dev/null
+++ b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/model/KameletLabelNames.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.kamelets.catalog.model;
+
+public interface KameletLabelNames {
+
+    String KAMELET_LABEL_TYPE = "camel.apache.org/kamelet.type";
+    String KAMELET_LABEL_PROVIDER = "camel.apache.org/provider";
+    String KAMELET_LABEL_ICON = "camel.apache.org/kamelet.icon";
+
+}