mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
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.
This commit is contained in:
parent
f9a4471eca
commit
d158bbd62a
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user