Commit fde23e81 authored by Matt Butcher's avatar Matt Butcher Committed by GitHub
Browse files

Merge pull request #1233 from technosophos/fix/1223-better-version-error

fix(helm): if server is old, report this in a friendly way
parents e9a69f37 85b70c48
No related merge requests found
Showing with 6 additions and 0 deletions
+6 -0
...@@ -17,10 +17,13 @@ limitations under the License. ...@@ -17,10 +17,13 @@ limitations under the License.
package main package main
import ( import (
"errors"
"fmt" "fmt"
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/version" "k8s.io/helm/pkg/version"
...@@ -56,6 +59,9 @@ func (v *versionCmd) run() error { ...@@ -56,6 +59,9 @@ func (v *versionCmd) run() error {
resp, err := v.client.GetVersion() resp, err := v.client.GetVersion()
if err != nil { if err != nil {
if grpc.Code(err) == codes.Unimplemented {
return errors.New("server is too old to know its version")
}
return err return err
} }
fmt.Fprintf(v.out, "Server: %#v\n", resp.Version) fmt.Fprintf(v.out, "Server: %#v\n", resp.Version)
......
Supports Markdown
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