Add /version to server and check it in client.

Will help detect client/version skew and prevent e2e test from passing
while running a version other than the one you think it's running.
This commit is contained in:
Daniel Smith
2014-07-25 12:28:20 -07:00
parent 9fc52c8aaa
commit 3b8488028d
9 changed files with 148 additions and 31 deletions

View File

@@ -16,6 +16,21 @@ limitations under the License.
package version
func Get() (major, minor, gitCommit string) {
return "v1beta", "1", commitFromGit
// Info contains versioning information.
// TODO: Add []string of api versions supported? It's still unclear
// how we'll want to distribute that information.
type Info struct {
Major string `json:"major" yaml:"major"`
Minor string `json:"minor" yaml:"minor"`
GitCommit string `json:"gitCommit" yaml:"gitCommit"`
}
// Get returns the overall codebase version. It's for detecting
// what code a binary was built from.
func Get() Info {
return Info{
Major: "0",
Minor: "1",
GitCommit: commitFromGit,
}
}