server: add internal version

release-0.4
Xiang Li 2015-01-22 15:23:15 -08:00
parent b077dcf6c4
commit 9a2d82854e
4 changed files with 5 additions and 6 deletions

View File

@ -913,9 +913,9 @@ func (s *PeerServer) monitorVersion() {
}
// only support upgrading to etcd2
if *resp.Node.Value == "2" {
log.Infof("%s: detected next internal version 2, exit after 10 seconds.", s.config.Name)
log.Infof("%s: detected next internal version 2, exit after 10 seconds.", s.Config.Name)
} else {
log.Infof("%s: detected invaild next internal version %s", s.config.Name, *resp.Node.Value)
log.Infof("%s: detected invaild next internal version %s", s.Config.Name, *resp.Node.Value)
continue
}
time.Sleep(10 * time.Second)

View File

@ -1,3 +0,0 @@
package server
const ReleaseVersion = "0.4.6"

View File

@ -285,7 +285,7 @@ func (s *Server) Dispatch(c raft.Command, w http.ResponseWriter, req *http.Reque
// Handler to return the current version of etcd.
func (s *Server) GetVersionHandler(w http.ResponseWriter, req *http.Request) error {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "etcd %s", ReleaseVersion)
fmt.Fprintf(w, `{"releaseVersion":"%s","internalVersion":"%s"}`, ReleaseVersion, InternalVersion)
return nil
}

View File

@ -1,3 +1,5 @@
package server
const ReleaseVersion = "0.4.6"
const InternalVersion = "1"
const Version = "v2"