mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 20:21:20 +00:00
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:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user