mirror of
https://github.com/rancher/os.git
synced 2025-09-20 18:13:35 +00:00
Merge pull request #158 from darnould/master
Add 'rancherctl os version' command
This commit is contained in:
@@ -51,6 +51,11 @@ func osSubcommands() []cli.Command {
|
|||||||
Usage: "list the current available versions",
|
Usage: "list the current available versions",
|
||||||
Action: osMetaDataGet,
|
Action: osMetaDataGet,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "version",
|
||||||
|
Usage: "show the currently installed version",
|
||||||
|
Action: osVersion,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +143,10 @@ func osUpgrade(c *cli.Context) {
|
|||||||
startUpgradeContainer(image, c.Bool("stage"), c.Bool("force"))
|
startUpgradeContainer(image, c.Bool("stage"), c.Bool("force"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func osVersion(c *cli.Context) {
|
||||||
|
fmt.Println(config.VERSION)
|
||||||
|
}
|
||||||
|
|
||||||
func yes(in *bufio.Reader, question string) bool {
|
func yes(in *bufio.Reader, question string) bool {
|
||||||
fmt.Printf("%s [y/N]: ", question)
|
fmt.Printf("%s [y/N]: ", question)
|
||||||
line, err := in.ReadString('\n')
|
line, err := in.ReadString('\n')
|
||||||
|
Reference in New Issue
Block a user