Skip to content

Commit

Permalink
add --additional-urls flag
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Jul 31, 2019
1 parent d7643ae commit f496b34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func createCliCommandTree(cmd *cobra.Command) {
cmd.PersistentFlags().BoolVar(&globals.Debug, "debug", false, "Enables debug output (super verbose, used to debug the CLI).")
cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be [text|json].")
cmd.PersistentFlags().StringVar(&globals.YAMLConfigFile, "config-file", "", "The custom config file (if not specified the default will be used).")
cmd.PersistentFlags().StringSliceVar(&globals.AdditionalUrls, "additional-urls", []string{}, "Additional URLs for the board manager.")
}

func preRun(cmd *cobra.Command, args []string) {
Expand Down
2 changes: 2 additions & 0 deletions cli/globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ var (
Config *configs.Configuration
// YAMLConfigFile contains the path to the config file
YAMLConfigFile string
// AdditionalUrls contains the list of additional urls the boards manager can use
AdditionalUrls []string
)

func getHTTPClientHeader() http.Header {
Expand Down
5 changes: 5 additions & 0 deletions cli/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func initInstance() *rpc.InitResp {

func packageManagerInitReq() *rpc.InitReq {
urls := []string{}

for _, urlString := range globals.AdditionalUrls {
urls = append(urls, urlString)
}

for _, URL := range globals.Config.BoardManagerAdditionalUrls {
urls = append(urls, URL.String())
}
Expand Down

0 comments on commit f496b34

Please sign in to comment.