Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implemented open default browser in local mode #2122

Merged
merged 18 commits into from
Feb 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions cmd/argo/commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import (

func NewServerCommand() *cobra.Command {
var (
logLevel string // --loglevel
authMode string
configMap string
port int
baseHRef string
namespaced bool // --namespaced
managedNamespace string // --managed-namespace
disableOpenBrowser bool
logLevel string // --loglevel
authMode string
configMap string
port int
baseHRef string
namespaced bool // --namespaced
managedNamespace string // --managed-namespace
enableOpenBrowser bool
)

var command = cobra.Command{
Expand Down Expand Up @@ -90,7 +90,7 @@ See %s`, help.ArgoSever),
return err
}
browserOpenFunc := func(url string) {}
sarabala1979 marked this conversation as resolved.
Show resolved Hide resolved
if !disableOpenBrowser {
if enableOpenBrowser {
browserOpenFunc = func(url string) {
log.Infof("Argo UI is available at %s", url)
err := open.Run(url)
Expand All @@ -115,6 +115,6 @@ See %s`, help.ArgoSever),
command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
command.Flags().BoolVar(&namespaced, "namespaced", false, "run as namespaced mode")
command.Flags().StringVar(&managedNamespace, "managed-namespace", "", "namespace that watches, default to the installation namespace")
command.Flags().BoolVar(&disableOpenBrowser, "disable-open-browser", false, "disable automatic launching of the browser [Hosted mode]")
command.Flags().BoolVarP(&enableOpenBrowser, "enable-open-browser" ,"b",false, "enable automatic launching of the browser [local mode]")
sarabala1979 marked this conversation as resolved.
Show resolved Hide resolved
return &command
}