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 2019/10/09 12:24:42 UTC

[camel-k] 03/04: chore(install): Do not create default platform when global option is set

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

commit eb176832330bdde7fc606ebb69ea07cd0bb60280
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Oct 8 16:42:34 2019 +0200

    chore(install): Do not create default platform when global option is set
---
 pkg/cmd/install.go | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index 77569e5..7205174 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -58,7 +58,7 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
 	cmd.Flags().BoolVar(&impl.skipOperatorSetup, "skip-operator-setup", false, "Do not install the operator in the namespace (in case there's a global one)")
 	cmd.Flags().BoolVar(&impl.skipClusterSetup, "skip-cluster-setup", false, "Skip the cluster-setup phase")
 	cmd.Flags().BoolVar(&impl.exampleSetup, "example", false, "Install example integration")
-	cmd.Flags().BoolVar(&impl.global, "global", false, "Configure the operator to watch all namespaces")
+	cmd.Flags().BoolVar(&impl.global, "global", false, "Configure the operator to watch all namespaces. No integration platform is created.")
 
 	cmd.Flags().StringVarP(&impl.outputFormat, "output", "o", "", "Output format. One of: json|yaml")
 	cmd.Flags().StringVar(&impl.registry.Organization, "organization", "", "A organization on the Docker registry that can be used to publish images")
@@ -249,9 +249,13 @@ func (o *installCmdOptions) install(cobraCmd *cobra.Command, _ []string) error {
 
 		platform.Spec.Resources.Kits = o.kits
 
-		err = install.RuntimeObjectOrCollect(o.Context, c, namespace, collection, platform)
-		if err != nil {
-			return err
+		// Do not create an integration platform in global mode as platforms are expected
+		// to be created in other namespaces
+		if !o.global {
+			err = install.RuntimeObjectOrCollect(o.Context, c, namespace, collection, platform)
+			if err != nil {
+				return err
+			}
 		}
 
 		if o.exampleSetup {