mirror of
https://github.com/rancher/rke.git
synced 2025-09-01 06:56:29 +00:00
add cluster version command
This commit is contained in:
@@ -34,6 +34,12 @@ func ClusterCommand() cli.Command {
|
||||
Action: clusterUpFromCli,
|
||||
Flags: clusterUpFlags,
|
||||
},
|
||||
cli.Command{
|
||||
Name: "version",
|
||||
Usage: "Show Cluster Kubernetes version",
|
||||
Action: getClusterVersion,
|
||||
Flags: []cli.Flag{},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -120,3 +126,12 @@ func resolveClusterFile(ctx *cli.Context) (string, error) {
|
||||
|
||||
return clusterFile, nil
|
||||
}
|
||||
|
||||
func getClusterVersion(ctx *cli.Context) error {
|
||||
serverVersion, err := cluster.GetK8sVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("Server Version: %s\n", serverVersion)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user