Skip to content

Commit

Permalink
version,cmd/operator-sdk/version: add go version, os, and arch to ver…
Browse files Browse the repository at this point in the history
…sion subcommand
  • Loading branch information
joelanford committed Aug 26, 2019
1 parent abac23c commit d0f44c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/operator-sdk/version/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewCmd() *cobra.Command {
if version == "unknown" {
version = ver.Version
}
fmt.Printf("operator-sdk version: %s, commit: %s\n", version, ver.GitCommit)
fmt.Printf("operator-sdk version: %q, commit: %q, go version: %q\n", version, ver.GitCommit, ver.GoVersion)
},
}
return versionCmd
Expand Down
6 changes: 6 additions & 0 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@

package version

import (
"fmt"
"runtime"
)

var (
Version = "v0.10.0+git"
GitVersion = "unknown"
GitCommit = "unknown"
GoVersion = fmt.Sprintf("%s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)
)

0 comments on commit d0f44c4

Please sign in to comment.