Skip to content

Commit

Permalink
Update version to use -dev suffix
Browse files Browse the repository at this point in the history
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 <filbranden@google.com>
  • Loading branch information
filbranden committed Sep 9, 2014
1 parent ffcfdd0 commit 61877f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/version/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ 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
// where X == Major version and Y == Minor version) should be created to point
// 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"
)

0 comments on commit 61877f2

Please sign in to comment.