*: move v2http handlers without /v2 prefix to etcdhttp

Lets --enable-v2=false configurations provide /metrics, /health, etc.

Fixes #8167
This commit is contained in:
Anthony Romano
2017-05-09 19:39:29 -07:00
committed by Gyu-Ho Lee
parent ff9a0a3527
commit 8ab42fb045
10 changed files with 308 additions and 192 deletions

View File

@ -37,6 +37,7 @@ import (
"github.com/coreos/etcd/client"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver"
"github.com/coreos/etcd/etcdserver/api/etcdhttp"
"github.com/coreos/etcd/etcdserver/api/v2http"
"github.com/coreos/etcd/etcdserver/api/v3client"
"github.com/coreos/etcd/etcdserver/api/v3election"
@ -631,7 +632,7 @@ func (m *member) Launch() error {
m.s.SyncTicker = time.NewTicker(500 * time.Millisecond)
m.s.Start()
m.raftHandler = &testutil.PauseableHandler{Next: v2http.NewPeerHandler(m.s)}
m.raftHandler = &testutil.PauseableHandler{Next: etcdhttp.NewPeerHandler(m.s)}
for _, ln := range m.PeerListeners {
hs := &httptest.Server{