From 2c252f845b734d44eff5b242577ee7c6055aa84a Mon Sep 17 00:00:00 2001 From: Kartikay <120778728+kartikaysaxena@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:50:23 +0530 Subject: [PATCH] fix: added missing environmentID flag (#198) * added missing environmentID flag Signed-off-by: Kartikay * removed example in a case Signed-off-by: Kartikay --------- Signed-off-by: Kartikay --- pkg/cmd/connect/connect.go | 2 +- pkg/cmd/connect/infra.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/connect/connect.go b/pkg/cmd/connect/connect.go index 96dfa6e4..3bef85e9 100644 --- a/pkg/cmd/connect/connect.go +++ b/pkg/cmd/connect/connect.go @@ -28,7 +28,7 @@ var ConnectCmd = &cobra.Command{ litmusctl connect chaos-infra --name="new-chaos-infra" --non-interactive #connect a chaos-infrastructure within a project - litmusctl connect chaos-infra --name="new-chaos-infra" --project-id="d861b650-1549-4574-b2ba-ab754058dd04" --non-interactive + litmusctl connect chaos-infra --name="new-chaos-infra" --environment-id="my-environment-id" --project-id="d861b650-1549-4574-b2ba-ab754058dd04" --non-interactive Note: The default location of the config file is $HOME/.litmusconfig, and can be overridden by a --config flag `, } diff --git a/pkg/cmd/connect/infra.go b/pkg/cmd/connect/infra.go index fa247e32..8c369472 100644 --- a/pkg/cmd/connect/infra.go +++ b/pkg/cmd/connect/infra.go @@ -105,7 +105,8 @@ var infraCmd = &cobra.Command{ os.Exit(1) } - newInfra.EnvironmentID, _ = cmd.Flags().GetString("environmentID") + newInfra.EnvironmentID, _ = cmd.Flags().GetString("environment-id") + if newInfra.EnvironmentID == "" { utils.Red.Print("Error: --environment flag is empty") os.Exit(1) @@ -271,7 +272,7 @@ func init() { infraCmd.Flags().BoolP("non-interactive", "n", false, "Set it to true for non interactive mode | Note: Always set the boolean flag as --non-interactive=Boolean") infraCmd.Flags().StringP("kubeconfig", "k", "", "Set to pass kubeconfig file if it is not in the default location ($HOME/.kube/config)") infraCmd.Flags().String("tolerations", "", "Set the tolerations for Chaos infra components | Format: '[{\"key\":\"key1\",\"value\":\"value1\",\"operator\":\"Exist\",\"effect\":\"NoSchedule\",\"tolerationSeconds\":30}]'") - + infraCmd.Flags().String("environment-id", "", "Set the environmentID for the Chaos infra installation") infraCmd.Flags().String("project-id", "", "Set the project-id to install Chaos infra for the particular project. To see the projects, apply litmusctl get projects") infraCmd.Flags().String("installation-mode", "cluster", "Set the installation mode for the kind of Chaos infra | Supported=cluster/namespace") infraCmd.Flags().String("name", "", "Set the Chaos infra name")