Loading go-apps/meepctl/cmd/build.go +3 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,9 @@ Valid targets:`, ValidArgs: []string{"all", "meep-frontend", "meep-ctrl-engine", "meep-webhook", "meep-mg-manager", "meep-mon-engine", "meep-tc-engine", "meep-tc-sidecar", "meep-virt-engine"}, Run: func(cmd *cobra.Command, args []string) { configValid := utils.ConfigValidate("") if !configValid { fmt.Println("Fix configuration issues before building") os.Exit(0) if !utils.ConfigValidate("") { fmt.Println("Fix configuration issues") return } targets := args Loading go-apps/meepctl/cmd/config.go +2 −2 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ Values may be changed using the available commands described below.`, sort.Strings(keys) _ = cmd.Help() fmt.Println("") fmt.Println("CONFIGURED VALUES") fmt.Println("========================================") for _, key := range keys { fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") }, } Loading go-apps/meepctl/cmd/configGitdir.go +16 −13 Original line number Diff line number Diff line Loading @@ -23,12 +23,11 @@ import ( var configGitdir = &cobra.Command{ Use: "gitdir [GIT dir path]", Short: "get/set GIT directory path in the meepctl config file", Long: `Get/Set GIT directory path in the meepctl config file`, Example: ` # Get currently configured GIT directory meepctl config gitdir # Configure GIT directory meepctl config gitdir /home/some-user/AdvantEDGE`, Long: "Get/Set GIT directory path in the meepctl config file", Example: " meepctl config gitdir /home/some-user/AdvantEDGE", Args: cobra.RangeArgs(0, 1), Run: func(cmd *cobra.Command, args []string) { key := "meep.gitdir" v, _ := cmd.Flags().GetBool("verbose") t, _ := cmd.Flags().GetBool("time") if v { Loading @@ -38,9 +37,13 @@ var configGitdir = &cobra.Command{ } start := time.Now() if len(args) > 0 { value := viper.GetString(key) if len(args) == 0 { _ = cmd.Help() fmt.Println("") } else { gitdir := args[0] valid, reason := utils.ConfigGitdirValid(gitdir) valid, reason := utils.ConfigPathValid(gitdir) if valid { cfg := utils.ConfigReadFile(viper.ConfigFileUsed()) cfg.Meep.Gitdir = gitdir Loading @@ -49,21 +52,21 @@ var configGitdir = &cobra.Command{ fmt.Println(err) } fmt.Println("Updated meep.gitdir with [" + gitdir + "]") value = gitdir } else { fmt.Println("Invalid Gitdir: " + reason) fmt.Println("") _ = cmd.Help() } } else { key := "meep.gitdir" fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") fmt.Println(key, ":", value) fmt.Println("========================================") elapsed := time.Since(start) if t { fmt.Println("Took ", elapsed.Round(time.Millisecond).String()) } }, } Loading go-apps/meepctl/cmd/configIp.go +16 −13 Original line number Diff line number Diff line Loading @@ -23,12 +23,11 @@ import ( var configIp = &cobra.Command{ Use: "ip [IP]", Short: "get/get node IP address in the meepctl config file", Long: `Get/Set node IP address in the meepctl config file`, Example: ` # Get currently configured node IP address meepctl config ip # Set node IP Address to 1.2.3.4 meepctl config ip 1.2.3.4`, Long: "Get/Set node IP address in the meepctl config file", Example: "meepctl config ip 1.2.3.4", Args: cobra.RangeArgs(0, 1), Run: func(cmd *cobra.Command, args []string) { key := "node.ip" v, _ := cmd.Flags().GetBool("verbose") t, _ := cmd.Flags().GetBool("time") if v { Loading @@ -38,7 +37,12 @@ var configIp = &cobra.Command{ } start := time.Now() if len(args) > 0 { value := viper.GetString(key) if len(args) == 0 { _ = cmd.Help() fmt.Println("") } else { ip := args[0] valid, reason := utils.ConfigIPValid(ip) if valid { Loading @@ -47,18 +51,17 @@ var configIp = &cobra.Command{ err := utils.ConfigWriteFile(cfg, viper.ConfigFileUsed()) if err != nil { fmt.Println(err) return } fmt.Println("Updated node.ip with [" + ip + "]") value = ip } else { fmt.Println("Invalid IP: " + reason) fmt.Println("") _ = cmd.Help() } } else { key := "node.ip" fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") fmt.Println(key, ":", value) fmt.Println("========================================") elapsed := time.Since(start) if t { Loading go-apps/meepctl/cmd/configKibana.go +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ var configKibana = &cobra.Command{ Long: `Configures Kibana (index pattern, saved objects such as dashboards, visualisations, etc.) Any Kibana saved object will be overwritten in the process if the object Id are the same meepctl config kibana.`, Args: cobra.ExactArgs(0), Run: func(cmd *cobra.Command, args []string) { t, _ := cmd.Flags().GetBool("time") start := time.Now() Loading Loading
go-apps/meepctl/cmd/build.go +3 −4 Original line number Diff line number Diff line Loading @@ -43,10 +43,9 @@ Valid targets:`, ValidArgs: []string{"all", "meep-frontend", "meep-ctrl-engine", "meep-webhook", "meep-mg-manager", "meep-mon-engine", "meep-tc-engine", "meep-tc-sidecar", "meep-virt-engine"}, Run: func(cmd *cobra.Command, args []string) { configValid := utils.ConfigValidate("") if !configValid { fmt.Println("Fix configuration issues before building") os.Exit(0) if !utils.ConfigValidate("") { fmt.Println("Fix configuration issues") return } targets := args Loading
go-apps/meepctl/cmd/config.go +2 −2 Original line number Diff line number Diff line Loading @@ -33,12 +33,12 @@ Values may be changed using the available commands described below.`, sort.Strings(keys) _ = cmd.Help() fmt.Println("") fmt.Println("CONFIGURED VALUES") fmt.Println("========================================") for _, key := range keys { fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") }, } Loading
go-apps/meepctl/cmd/configGitdir.go +16 −13 Original line number Diff line number Diff line Loading @@ -23,12 +23,11 @@ import ( var configGitdir = &cobra.Command{ Use: "gitdir [GIT dir path]", Short: "get/set GIT directory path in the meepctl config file", Long: `Get/Set GIT directory path in the meepctl config file`, Example: ` # Get currently configured GIT directory meepctl config gitdir # Configure GIT directory meepctl config gitdir /home/some-user/AdvantEDGE`, Long: "Get/Set GIT directory path in the meepctl config file", Example: " meepctl config gitdir /home/some-user/AdvantEDGE", Args: cobra.RangeArgs(0, 1), Run: func(cmd *cobra.Command, args []string) { key := "meep.gitdir" v, _ := cmd.Flags().GetBool("verbose") t, _ := cmd.Flags().GetBool("time") if v { Loading @@ -38,9 +37,13 @@ var configGitdir = &cobra.Command{ } start := time.Now() if len(args) > 0 { value := viper.GetString(key) if len(args) == 0 { _ = cmd.Help() fmt.Println("") } else { gitdir := args[0] valid, reason := utils.ConfigGitdirValid(gitdir) valid, reason := utils.ConfigPathValid(gitdir) if valid { cfg := utils.ConfigReadFile(viper.ConfigFileUsed()) cfg.Meep.Gitdir = gitdir Loading @@ -49,21 +52,21 @@ var configGitdir = &cobra.Command{ fmt.Println(err) } fmt.Println("Updated meep.gitdir with [" + gitdir + "]") value = gitdir } else { fmt.Println("Invalid Gitdir: " + reason) fmt.Println("") _ = cmd.Help() } } else { key := "meep.gitdir" fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") fmt.Println(key, ":", value) fmt.Println("========================================") elapsed := time.Since(start) if t { fmt.Println("Took ", elapsed.Round(time.Millisecond).String()) } }, } Loading
go-apps/meepctl/cmd/configIp.go +16 −13 Original line number Diff line number Diff line Loading @@ -23,12 +23,11 @@ import ( var configIp = &cobra.Command{ Use: "ip [IP]", Short: "get/get node IP address in the meepctl config file", Long: `Get/Set node IP address in the meepctl config file`, Example: ` # Get currently configured node IP address meepctl config ip # Set node IP Address to 1.2.3.4 meepctl config ip 1.2.3.4`, Long: "Get/Set node IP address in the meepctl config file", Example: "meepctl config ip 1.2.3.4", Args: cobra.RangeArgs(0, 1), Run: func(cmd *cobra.Command, args []string) { key := "node.ip" v, _ := cmd.Flags().GetBool("verbose") t, _ := cmd.Flags().GetBool("time") if v { Loading @@ -38,7 +37,12 @@ var configIp = &cobra.Command{ } start := time.Now() if len(args) > 0 { value := viper.GetString(key) if len(args) == 0 { _ = cmd.Help() fmt.Println("") } else { ip := args[0] valid, reason := utils.ConfigIPValid(ip) if valid { Loading @@ -47,18 +51,17 @@ var configIp = &cobra.Command{ err := utils.ConfigWriteFile(cfg, viper.ConfigFileUsed()) if err != nil { fmt.Println(err) return } fmt.Println("Updated node.ip with [" + ip + "]") value = ip } else { fmt.Println("Invalid IP: " + reason) fmt.Println("") _ = cmd.Help() } } else { key := "node.ip" fmt.Println(key, ":", viper.GetString(key)) } fmt.Println("========================================") fmt.Println(key, ":", value) fmt.Println("========================================") elapsed := time.Since(start) if t { Loading
go-apps/meepctl/cmd/configKibana.go +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ var configKibana = &cobra.Command{ Long: `Configures Kibana (index pattern, saved objects such as dashboards, visualisations, etc.) Any Kibana saved object will be overwritten in the process if the object Id are the same meepctl config kibana.`, Args: cobra.ExactArgs(0), Run: func(cmd *cobra.Command, args []string) { t, _ := cmd.Flags().GetBool("time") start := time.Now() Loading