From d158bbd62a272b0d5128d773a42493cf09b518f6 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Wed, 11 Feb 2015 17:02:47 -0800 Subject: [PATCH] Print client version before evaluating server's. This will allow the client version to be printed even if the server version is not available. Fixes #4098. --- pkg/kubectl/version.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/kubectl/version.go b/pkg/kubectl/version.go index 4bb6b516bc502..ad65769a304f8 100644 --- a/pkg/kubectl/version.go +++ b/pkg/kubectl/version.go @@ -26,13 +26,14 @@ import ( ) func GetVersion(w io.Writer, kubeClient client.Interface) { + GetClientVersion(w) + serverVersion, err := kubeClient.ServerVersion() if err != nil { fmt.Printf("Couldn't read version from server: %v\n", err) os.Exit(1) } - GetClientVersion(w) fmt.Fprintf(w, "Server Version: %#v\n", *serverVersion) }