Skip to content

Commit

Permalink
Fix #194
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 authored and mangelajo committed Mar 5, 2020
1 parent 44f4685 commit fa79517
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/subctl/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ var joinCmd = &cobra.Command{
err := checkArgumentPassed(args)
exitOnError("Argument missing", err)
subctlData, err := datafile.NewFromFile(args[0])
if subctlData.ServiceDiscovery {
err = checkBrokerContextPassed(brokerClusterContext)
}
exitOnError("Argument missing", err)
exitOnError("Error loading the broker information from the given file", err)
fmt.Printf("* %s says broker is at: %s\n", args[0], subctlData.BrokerURL)
exitOnError("Error connecting to broker cluster", err)
Expand All @@ -112,6 +116,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 fa79517

Please sign in to comment.