Merge pull request #863 from umohnani8/version

kpod version
This commit is contained in:
Daniel J Walsh 2017-09-11 12:10:11 -04:00 committed by GitHub
commit c56dcf2cb5
5 changed files with 19 additions and 2 deletions

View file

@ -85,6 +85,8 @@ func debugInfo(c *cli.Context) (string, map[string]interface{}, error) {
info := map[string]interface{}{}
info["compiler"] = runtime.Compiler
info["go version"] = runtime.Version()
info["kpod version"] = c.App.Version
info["git commit"] = gitCommit
return "debug", info, nil
}

View file

@ -8,6 +8,10 @@ import (
"github.com/urfave/cli"
)
// This is populated by the Makefile from the VERSION file
// in the repository
var kpodVersion = ""
func main() {
if reexec.Init() {
return
@ -16,7 +20,12 @@ func main() {
app := cli.NewApp()
app.Name = "kpod"
app.Usage = "manage pods and images"
app.Version = "0.0.1"
var v string
if kpodVersion != "" {
v = kpodVersion
}
app.Version = v
app.Commands = []cli.Command{
diffCommand,

View file

@ -11,7 +11,11 @@ import (
// Overwritten at build time
var (
// gitCommit is the commit that the binary is being built from.
// It will be populated by the Makefile.
gitCommit string
// buildInfo is the time at which the binary was built
// It will be populated by the Makefile.
buildInfo string
)