diff options
Diffstat (limited to 'cmd/client/client.go')
-rw-r--r-- | cmd/client/client.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/client/client.go b/cmd/client/client.go index b72003d..afc7a1d 100644 --- a/cmd/client/client.go +++ b/cmd/client/client.go | |||
@@ -37,7 +37,7 @@ func NewClientCommand(appVersion string) *cobra.Command { | |||
37 | Run: func(c *cobra.Command, args []string) { | 37 | Run: func(c *cobra.Command, args []string) { |
38 | cfg := app.Config{} | 38 | cfg := app.Config{} |
39 | cli.MustGetConfig(c, &cfg) | 39 | cli.MustGetConfig(c, &cfg) |
40 | clientMain(cfg, args[0], args[1], args[2]) | 40 | clientMain(cfg, appVersion, args[0], args[1], args[2]) |
41 | }, | 41 | }, |
42 | } | 42 | } |
43 | cli.AddFlags(clientCmd, &app.Config{}, app.DefaultConfig, "client") | 43 | cli.AddFlags(clientCmd, &app.Config{}, app.DefaultConfig, "client") |
@@ -202,12 +202,16 @@ func fetchOauthToken(ctx context.Context, clientId, proxyHost string) (string, e | |||
202 | return tokenResponse.AccessToken, nil | 202 | return tokenResponse.AccessToken, nil |
203 | } | 203 | } |
204 | 204 | ||
205 | func clientMain(cfg app.Config, host, port, username string) { | 205 | func clientMain(cfg app.Config, appVersion, host, port, username string) { |
206 | log.SetOutput(os.Stderr) | 206 | log.SetOutput(os.Stderr) |
207 | 207 | ||
208 | ctx, cancel := context.WithCancel(context.Background()) | 208 | ctx, cancel := context.WithCancel(context.Background()) |
209 | defer cancel() | 209 | defer cancel() |
210 | 210 | ||
211 | if err := upgradeAndRestartClient(ctx, appVersion, cfg.ClientHost); err != nil { | ||
212 | log.Fatalf("Error attempting to upgrade client: %s", err) | ||
213 | } | ||
214 | |||
211 | agentConn, err := connectToAgent() | 215 | agentConn, err := connectToAgent() |
212 | if err != nil { | 216 | if err != nil { |
213 | log.Fatalf("Error connecting to agent, is it started?") | 217 | log.Fatalf("Error connecting to agent, is it started?") |