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 8d61a70  fix: Add embedded kamelets directory check back
8d61a70 is described below

commit 8d61a708a16945df17f4af30aacb9dd8c13e5517
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Thu Feb 11 09:16:44 2021 +0100

    fix: Add embedded kamelets directory check back
---
 pkg/install/kamelets.go | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/pkg/install/kamelets.go b/pkg/install/kamelets.go
index b3f23f0..d6871a7 100644
--- a/pkg/install/kamelets.go
+++ b/pkg/install/kamelets.go
@@ -22,24 +22,29 @@ import (
        "path"
        "strings"
 
-       "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
-       "github.com/apache/camel-k/pkg/client"
-       "github.com/apache/camel-k/pkg/resources"
-       "github.com/apache/camel-k/pkg/util/defaults"
-       "github.com/apache/camel-k/pkg/util/kubernetes"
        "github.com/pkg/errors"
        k8serrors "k8s.io/apimachinery/pkg/api/errors"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        "k8s.io/apimachinery/pkg/runtime"
        "k8s.io/apimachinery/pkg/types"
+
+       "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
+       "github.com/apache/camel-k/pkg/client"
+       "github.com/apache/camel-k/pkg/resources"
+       "github.com/apache/camel-k/pkg/util/defaults"
+       "github.com/apache/camel-k/pkg/util/kubernetes"
 )
 
 const kameletDir = "/kamelets/"
 const kameletBundledLabel = "camel.apache.org/kamelet.bundled"
 const kameletReadOnlyLabel = "camel.apache.org/kamelet.readonly"
 
-// KameletCatalog installs the bundlet KameletCatalog into one namespace
+// KameletCatalog installs the bundled KameletCatalog into one namespace
 func KameletCatalog(ctx context.Context, c client.Client, namespace string) 
error {
+       if !resources.DirExists(kameletDir) {
+               return nil
+       }
+
        for _, res := range resources.Resources(kameletDir) {
                if !strings.HasSuffix(res, ".yaml") && !strings.HasSuffix(res, 
".yml") {
                        continue

Reply via email to