server: add internal version
parent
b077dcf6c4
commit
9a2d82854e
|
@ -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)
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
package server
|
||||
|
||||
const ReleaseVersion = "0.4.6"
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
package server
|
||||
|
||||
const ReleaseVersion = "0.4.6"
|
||||
const InternalVersion = "1"
|
||||
const Version = "v2"
|
||||
|
|
Loading…
Reference in New Issue