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

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


The following commit(s) were added to refs/heads/main by this push:
     new 99fa53814 fix(cmd): cannot load catalog on CLI
99fa53814 is described below

commit 99fa538147708b8c75d0a8051b2ee36434f1d22f
Author: Pasquale Congiusti <pasquale.congiu...@gmail.com>
AuthorDate: Wed Mar 27 13:32:54 2024 +0100

    fix(cmd): cannot load catalog on CLI
---
 pkg/cmd/run.go         |  2 +-
 pkg/cmd/run_support.go | 31 +------------------------------
 2 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 548f642a0..46f6cade3 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -851,7 +851,7 @@ func (o *runCmdOptions) applyDependencies(cmd 
*cobra.Command, c client.Client, i
                                // And the validation only warns potential 
misusage of Camel components at the CLI level,
                                // so strictness of catalog version is not 
necessary here.
                                var err error
-                               catalog, err = createCamelCatalog(o.Context)
+                               catalog, err = createCamelCatalog()
                                if err != nil {
                                        return err
                                }
diff --git a/pkg/cmd/run_support.go b/pkg/cmd/run_support.go
index e4bb8063b..882adb979 100644
--- a/pkg/cmd/run_support.go
+++ b/pkg/cmd/run_support.go
@@ -32,9 +32,7 @@ import (
        v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
        "github.com/apache/camel-k/v2/pkg/client"
        "github.com/apache/camel-k/v2/pkg/util/camel"
-       "github.com/apache/camel-k/v2/pkg/util/defaults"
        "github.com/apache/camel-k/v2/pkg/util/kubernetes"
-       "github.com/apache/camel-k/v2/pkg/util/maven"
        "github.com/apache/camel-k/v2/pkg/util/resource"
        "github.com/magiconair/properties"
        "github.com/spf13/cobra"
@@ -182,40 +180,13 @@ func validatePropertyFile(fileName string) error {
        return nil
 }
 
-func createCamelCatalog(ctx context.Context) (*camel.RuntimeCatalog, error) {
+func createCamelCatalog() (*camel.RuntimeCatalog, error) {
        // Attempt to reuse existing Camel catalog if one is present
        catalog, err := camel.DefaultCatalog()
        if err != nil {
                return nil, err
        }
 
-       // Generate catalog if one was not found
-       if catalog == nil {
-               catalog, err = generateCatalog(ctx)
-               if err != nil {
-                       return nil, err
-               }
-       }
-
-       return catalog, nil
-}
-
-func generateCatalog(ctx context.Context) (*camel.RuntimeCatalog, error) {
-       // A Camel catalog is required for this operation
-       mvn := v1.MavenSpec{
-               LocalRepository: "",
-       }
-       runtime := v1.RuntimeSpec{
-               Version:  defaults.DefaultRuntimeVersion,
-               Provider: v1.RuntimeProviderQuarkus,
-       }
-       var providerDependencies []maven.Dependency
-       var caCert [][]byte
-       catalog, err := camel.GenerateCatalogCommon(ctx, nil, nil, caCert, mvn, 
runtime, providerDependencies)
-       if err != nil {
-               return nil, err
-       }
-
        return catalog, nil
 }
 

Reply via email to