mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #2131 from xiang90/version
etcdhttp: add internalVersion
This commit is contained in:
commit
f16ff64949
@ -335,7 +335,7 @@ func serveVersion(w http.ResponseWriter, r *http.Request) {
|
||||
if !allowMethod(w, r.Method, "GET") {
|
||||
return
|
||||
}
|
||||
w.Write([]byte("etcd " + version.Version))
|
||||
fmt.Fprintf(w, `{"releaseVersion":"%s","internalVersion":"%s"}`, version.Version, version.InternalVersion)
|
||||
}
|
||||
|
||||
// parseKeyRequest converts a received http.Request on keysPrefix to
|
||||
|
@ -1329,7 +1329,7 @@ func TestServeVersion(t *testing.T) {
|
||||
if rw.Code != http.StatusOK {
|
||||
t.Errorf("code=%d, want %d", rw.Code, http.StatusOK)
|
||||
}
|
||||
w := fmt.Sprintf("etcd %s", version.Version)
|
||||
w := fmt.Sprintf(`{"releaseVersion":"%s","internalVersion":"%s"}`, version.Version, version.InternalVersion)
|
||||
if g := rw.Body.String(); g != w {
|
||||
t.Fatalf("body = %q, want %q", g, w)
|
||||
}
|
||||
|
@ -17,5 +17,6 @@
|
||||
package version
|
||||
|
||||
var (
|
||||
Version = "2.0.0-rc.1"
|
||||
Version = "2.0.0-rc.1"
|
||||
InternalVersion = "2"
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user