Skip to content

Commit

Permalink
setup connection after displaying client version
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Fisher committed Aug 1, 2018
1 parent bda27b6 commit a7ab81f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions cmd/helm/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ func newVersionCmd(c helm.Interface, out io.Writer) *cobra.Command {
if !version.showClient && !version.showServer {
version.showClient, version.showServer = true, true
}
if version.showServer {
// We do this manually instead of in PreRun because we only
// need a tunnel if server version is requested.
err := setupConnection()
if err != nil {
return err
}
}
version.client = ensureHelmClient(version.client)
return version.run()
},
}
Expand Down Expand Up @@ -111,6 +102,13 @@ func (v *versionCmd) run() error {
return tpl(v.template, data, v.out)
}

// We do this manually instead of in PreRun because we only
// need a tunnel if server version is requested.
if err := setupConnection(); err != nil {
return err
}
v.client = ensureHelmClient(v.client)

if settings.Debug {
k8sVersion, err := getK8sVersion()
if err != nil {
Expand Down

0 comments on commit a7ab81f

Please sign in to comment.