From 61877f2dd0e7ddeadf4096f0c677348972e5f9ec Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Tue, 9 Sep 2014 15:41:48 -0700 Subject: [PATCH] Update version to use -dev suffix According to the plan listed in docs/releasing.md. The gitMinor will keep using a "+" suffix instead for now. Added a //TODO to deprecate gitMajor and gitMinor in a follow up. Tested: - Built it from the git tree: $ make $ _output/go/bin/kubecfg -version Kubernetes version 0.2+, build 8d31eb03c11d4db64ae26809eef7f73070efd811 $ _output/go/bin/kubecfg -version=raw version.Info{Major:"0", Minor:"2+", GitVersion:"v0.2-29-g8d31eb03c11d4d", GitCommit:"8d31eb03c11d4db64ae26809eef7f73070efd811", GitTreeState:"clean"} - Built it with a direct `go install` (same as tarball): $ GOPATH=${PWD}/_output/go:${PWD}/Godeps/_workspace go install $KUBE_GO_PACKAGE/cmd/kubecfg $ _output/go/bin/kubecfg -version=raw version.Info{Major:"0", Minor:"2+", GitVersion:"v0.2-dev", GitCommit:"", GitTreeState:"not a git tree"} $ _output/go/bin/kubecfg -version Kubernetes version 0.2+, build (unknown) A follow up commit will address the output of the -version (without "raw") command to use gitVersion instead of Major + Minor. Signed-off-by: Filipe Brandenburger --- pkg/version/base.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/version/base.go b/pkg/version/base.go index 6ea631cf943..47ec6b565ac 100644 --- a/pkg/version/base.go +++ b/pkg/version/base.go @@ -23,9 +23,10 @@ package version // version for ad-hoc builds (e.g. `go build`) that cannot get the version // information from git. // -// The "+" in the version info indicates that fact, and it means the current -// build is from a version greater or equal to that version. -// (e.g. v0.7+ means version >= 0.7 and < 0.8) +// The "-dev" suffix in the version info indicates that fact, and it means the +// current build is from a version greater that version. For example, v0.7-dev +// means version > 0.7 and < 0.8. (There's exceptions to this rule, see +// docs/releasing.md for more details.) // // When releasing a new Kubernetes version, this file should be updated to // reflect the new version, and then a git annotated tag (using format vX.Y @@ -33,9 +34,10 @@ package version // to the commit that updates pkg/version/base.go var ( + // TODO: Deprecate gitMajor and gitMinor, use only gitVersion instead. gitMajor string = "0" // major version, always numeric gitMinor string = "2+" // minor version, numeric possibly followed by "+" - gitVersion string = "v0.2+" // version from git, output of $(git describe) + gitVersion string = "v0.2-dev" // version from git, output of $(git describe) gitCommit string = "" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty" )