Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added check for broker-cluster-context parameter

Signed-off-by: Aswin Surayanarayanan <[email protected]>
  • Loading branch information
aswinsuryan committed Mar 4, 2020
1 parent 70626f4 commit 677b049
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/subctl/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ var joinCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
err := checkArgumentPassed(args)
exitOnError("Argument missing", err)
err = checkBrokerContextPassed(brokerClusterContext)
exitOnError("Argument missing", err)
subctlData, err := datafile.NewFromFile(args[0])
exitOnError("Error loading the broker information from the given file", err)
fmt.Printf("* %s says broker is at: %s\n", args[0], subctlData.BrokerURL)
Expand All @@ -112,6 +114,13 @@ func checkArgumentPassed(args []string) error {
return nil
}

func checkBrokerContextPassed(brokerClusterContext string) error {
if (brokerClusterContext == "") {
return errors.New("brokerClusterContext is not passed")
}
return nil
}

func joinSubmarinerCluster(config *rest.Config, subctlData *datafile.SubctlData) {

// Missing information
Expand Down

0 comments on commit 677b049

Please sign in to comment.