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/12/02 08:05:53 UTC

[camel-k] branch main updated: fix(cli): Skip version compatibility check for builder command

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

astefanutti 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 372aed0  fix(cli): Skip version compatibility check for builder command
372aed0 is described below

commit 372aed01a38b3417128acf93acc9de1663653060
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Dec 1 14:31:54 2021 +0100

    fix(cli): Skip version compatibility check for builder command
---
 pkg/cmd/builder.go | 4 +++-
 pkg/cmd/root.go    | 8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/pkg/cmd/builder.go b/pkg/cmd/builder.go
index ac93a47..e1702ca 100644
--- a/pkg/cmd/builder.go
+++ b/pkg/cmd/builder.go
@@ -22,12 +22,14 @@ import (
 	"github.com/spf13/cobra"
 )
 
+const builderCommand = "builder"
+
 func newCmdBuilder(rootCmdOptions *RootCmdOptions) (*cobra.Command, *builderCmdOptions) {
 	options := builderCmdOptions{
 		RootCmdOptions: rootCmdOptions,
 	}
 	cmd := cobra.Command{
-		Use:     "builder",
+		Use:     builderCommand,
 		Short:   "Run the Camel K builder",
 		Long:    `Run the Camel K builder`,
 		Hidden:  true,
diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go
index ffa3714..b219554 100644
--- a/pkg/cmd/root.go
+++ b/pkg/cmd/root.go
@@ -30,7 +30,7 @@ import (
 	k8serrors "k8s.io/apimachinery/pkg/api/errors"
 
 	"github.com/apache/camel-k/pkg/client"
-	camelv1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1"
+	v1 "github.com/apache/camel-k/pkg/client/camel/clientset/versioned/typed/camel/v1"
 	"github.com/apache/camel-k/pkg/util/defaults"
 )
 
@@ -194,7 +194,7 @@ func (command *RootCmdOptions) preRun(cmd *cobra.Command, _ []string) error {
 		// reconciled. Hence the compatibility check is skipped for the install and the operator command.
 		// Furthermore, there can be any incompatibilities, as the install command deploys
 		// the operator version it's compatible with.
-		if cmd.Use != installCommand && cmd.Use != operatorCommand {
+		if cmd.Use != builderCommand && cmd.Use != installCommand && cmd.Use != operatorCommand {
 			checkAndShowCompatibilityWarning(command.Context, cmd, c, command.Namespace)
 		}
 	}
@@ -229,12 +229,12 @@ func (command *RootCmdOptions) GetCmdClient() (client.Client, error) {
 }
 
 // GetCamelCmdClient returns a client to access the Camel resources.
-func (command *RootCmdOptions) GetCamelCmdClient() (*camelv1.CamelV1Client, error) {
+func (command *RootCmdOptions) GetCamelCmdClient() (*v1.CamelV1Client, error) {
 	c, err := command.GetCmdClient()
 	if err != nil {
 		return nil, err
 	}
-	return camelv1.NewForConfig(c.GetConfig())
+	return v1.NewForConfig(c.GetConfig())
 }
 
 // NewCmdClient returns a new client that can be used from command line tools.