genericapiserver: cut off kube pkg/version dependency

This commit is contained in:
Dr. Stefan Schimanski
2017-01-16 12:05:15 +01:00
parent f0b0cd0399
commit 52f6831576
27 changed files with 176 additions and 105 deletions

View File

@@ -19,29 +19,16 @@ package version
import (
"fmt"
"runtime"
)
// 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"`
Minor string `json:"minor"`
GitVersion string `json:"gitVersion"`
GitCommit string `json:"gitCommit"`
GitTreeState string `json:"gitTreeState"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
Compiler string `json:"compiler"`
Platform string `json:"platform"`
}
apimachineryversion "k8s.io/apimachinery/pkg/version"
)
// Get returns the overall codebase version. It's for detecting
// what code a binary was built from.
func Get() Info {
func Get() apimachineryversion.Info {
// These variables typically come from -ldflags settings and in
// their absence fallback to the settings in pkg/version/base.go
return Info{
return apimachineryversion.Info{
Major: gitMajor,
Minor: gitMinor,
GitVersion: gitVersion,
@@ -53,8 +40,3 @@ func Get() Info {
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
}
}
// String returns info as a human-friendly version string.
func (info Info) String() string {
return info.GitVersion
}