mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdhttp: add internalVersion
This commit is contained in:
parent
7d33a2686c
commit
a77bf97c14
@ -335,7 +335,7 @@ func serveVersion(w http.ResponseWriter, r *http.Request) {
|
|||||||
if !allowMethod(w, r.Method, "GET") {
|
if !allowMethod(w, r.Method, "GET") {
|
||||||
return
|
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
|
// parseKeyRequest converts a received http.Request on keysPrefix to
|
||||||
|
@ -1329,7 +1329,7 @@ func TestServeVersion(t *testing.T) {
|
|||||||
if rw.Code != http.StatusOK {
|
if rw.Code != http.StatusOK {
|
||||||
t.Errorf("code=%d, want %d", 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 {
|
if g := rw.Body.String(); g != w {
|
||||||
t.Fatalf("body = %q, want %q", g, w)
|
t.Fatalf("body = %q, want %q", g, w)
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,6 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Version = "2.0.0-rc.1"
|
Version = "2.0.0-rc.1"
|
||||||
|
InternalVersion = "2"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user