add get available versions commmand

This commit is contained in:
Young
2015-03-17 13:51:18 +00:00
parent 5c99bc9e96
commit 97b647207e
4 changed files with 72 additions and 0 deletions

View File

@@ -40,3 +40,13 @@ func GetVersion(w io.Writer, kubeClient client.Interface) {
func GetClientVersion(w io.Writer) {
fmt.Fprintf(w, "Client Version: %#v\n", version.Get())
}
func GetApiVersions(w io.Writer, kubeClient client.Interface) {
apiVersions, err := kubeClient.ServerAPIVersions()
if err != nil {
fmt.Printf("Couldn't get available api versions from server: %v\n", err)
os.Exit(1)
}
fmt.Fprintf(w, "Available Server Api Versions: %#v\n", *apiVersions)
}