Skip to content

Commit

Permalink
fix: added missing environmentID flag (#198)
Browse files Browse the repository at this point in the history
* added missing environmentID flag

Signed-off-by: Kartikay <[email protected]>

* removed example in a case

Signed-off-by: Kartikay <[email protected]>

---------

Signed-off-by: Kartikay <[email protected]>
  • Loading branch information
kartikaysaxena authored Feb 15, 2024
1 parent 8a139b0 commit 2c252f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/connect/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
}
5 changes: 3 additions & 2 deletions pkg/cmd/connect/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2c252f8

Please sign in to comment.