fix: Add embedded kamelets directory check back
@@ -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
