From 3a36ab67e9401e41f7248494768b118277e6f4ac Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Fri, 7 Jun 2019 12:40:06 -0700 Subject: [PATCH] add go version to version cmd output of helm Signed-off-by: Tariq Ibrahim --- cmd/helm/testdata/output/version.txt | 2 +- internal/version/version.go | 3 +++ pkg/version/version.go | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/helm/testdata/output/version.txt b/cmd/helm/testdata/output/version.txt index 9cc619059..ce769858b 100644 --- a/cmd/helm/testdata/output/version.txt +++ b/cmd/helm/testdata/output/version.txt @@ -1 +1 @@ -version.BuildInfo{Version:"v3.0+unreleased", GitCommit:"", GitTreeState:""} +version.BuildInfo{Version:"v3.0+unreleased", GitCommit:"", GitTreeState:"", GoVersion:"go1.12.5"} diff --git a/internal/version/version.go b/internal/version/version.go index 41271c042..0d12d7a1a 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -17,6 +17,8 @@ limitations under the License. package version // import "helm.sh/helm/internal/version" import ( + "runtime" + hversion "helm.sh/helm/pkg/version" ) @@ -52,5 +54,6 @@ func Get() hversion.BuildInfo { Version: GetVersion(), GitCommit: gitCommit, GitTreeState: gitTreeState, + GoVersion: runtime.Version(), } } diff --git a/pkg/version/version.go b/pkg/version/version.go index 6d0a39f9a..036e723da 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -20,8 +20,10 @@ package version // import "helm.sh/helm/pkg/version" type BuildInfo struct { // Version is the current semver. Version string `json:"version,omitempty"` - // GitCommit is the git sha1 + // GitCommit is the git sha1. GitCommit string `json:"git_commit,omitempty"` - // GitTreeState is the state of the git tree + // GitTreeState is the state of the git tree. GitTreeState string `json:"git_tree_state,omitempty"` + // GoVersion is the version of the Go compiler used. + GoVersion string `json:"go_version,omitempty"` }