|
@@ -19,17 +19,27 @@ package version
|
|
|
import (
|
|
import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"strings"
|
|
"strings"
|
|
|
|
|
+
|
|
|
|
|
+ "github.com/coreos/go-semver/semver"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
|
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
|
|
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
|
|
|
MinClusterVersion = "3.0.0"
|
|
MinClusterVersion = "3.0.0"
|
|
|
Version = "3.1.0-rc.0+git"
|
|
Version = "3.1.0-rc.0+git"
|
|
|
|
|
+ APIVersion = "unknown"
|
|
|
|
|
|
|
|
// Git SHA Value will be set during build
|
|
// Git SHA Value will be set during build
|
|
|
GitSHA = "Not provided (use ./build instead of go build)"
|
|
GitSHA = "Not provided (use ./build instead of go build)"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+func init() {
|
|
|
|
|
+ ver, err := semver.NewVersion(Version)
|
|
|
|
|
+ if err == nil {
|
|
|
|
|
+ APIVersion = fmt.Sprintf("%d.%d", ver.Major, ver.Minor)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
type Versions struct {
|
|
type Versions struct {
|
|
|
Server string `json:"etcdserver"`
|
|
Server string `json:"etcdserver"`
|
|
|
Cluster string `json:"etcdcluster"`
|
|
Cluster string `json:"etcdcluster"`
|