2014-08-27 16:08:04 +00:00
|
|
|
/*
|
2015-05-01 16:19:44 +00:00
|
|
|
Copyright 2014 The Kubernetes Authors All rights reserved.
|
2014-08-27 16:08:04 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package version
|
|
|
|
|
|
|
|
// Base version information.
|
|
|
|
//
|
|
|
|
// This is the fallback data used when version information from git is not
|
|
|
|
// provided via go ldflags. It provides an approximation of the Kubernetes
|
|
|
|
// version for ad-hoc builds (e.g. `go build`) that cannot get the version
|
|
|
|
// information from git.
|
|
|
|
//
|
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 <filbranden@google.com>
2014-09-09 22:41:48 +00:00
|
|
|
// 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.)
|
2014-08-27 16:08:04 +00:00
|
|
|
//
|
|
|
|
// 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 (
|
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 <filbranden@google.com>
2014-09-09 22:41:48 +00:00
|
|
|
// TODO: Deprecate gitMajor and gitMinor, use only gitVersion instead.
|
2014-08-27 16:08:04 +00:00
|
|
|
gitMajor string = "0" // major version, always numeric
|
2015-05-12 04:43:34 +00:00
|
|
|
gitMinor string = "17.0+" // minor version, numeric possibly followed by "+"
|
|
|
|
gitVersion string = "v0.17.0-dev" // version from git, output of $(git describe)
|
2014-08-27 16:08:04 +00:00
|
|
|
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"
|
|
|
|
)
|