Commit 558dcf3c authored by Sam Leavens's avatar Sam Leavens

Only show k8s version if asking for server version

parent fa40e60f
...@@ -90,14 +90,6 @@ func newVersionCmd(c helm.Interface, out io.Writer) *cobra.Command { ...@@ -90,14 +90,6 @@ func newVersionCmd(c helm.Interface, out io.Writer) *cobra.Command {
} }
func (v *versionCmd) run() error { func (v *versionCmd) run() error {
if settings.Debug {
k8sVersion, err := getK8sVersion()
if err != nil {
return err
}
fmt.Fprintf(v.out, "Kubernetes: %#v\n", k8sVersion)
}
if v.showClient { if v.showClient {
cv := version.GetVersionProto() cv := version.GetVersionProto()
fmt.Fprintf(v.out, "Client: %s\n", formatVersion(cv, v.short)) fmt.Fprintf(v.out, "Client: %s\n", formatVersion(cv, v.short))
...@@ -107,6 +99,14 @@ func (v *versionCmd) run() error { ...@@ -107,6 +99,14 @@ func (v *versionCmd) run() error {
return nil return nil
} }
if settings.Debug {
k8sVersion, err := getK8sVersion()
if err != nil {
return err
}
fmt.Fprintf(v.out, "Kubernetes: %#v\n", k8sVersion)
}
resp, err := v.client.GetVersion() resp, err := v.client.GetVersion()
if err != nil { if err != nil {
if grpc.Code(err) == codes.Unimplemented { if grpc.Code(err) == codes.Unimplemented {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment