|
@@ -29,6 +29,8 @@ import (
|
|
|
"github.com/coreos/etcd/etcdserver"
|
|
"github.com/coreos/etcd/etcdserver"
|
|
|
"github.com/coreos/etcd/etcdserver/api/etcdhttp"
|
|
"github.com/coreos/etcd/etcdserver/api/etcdhttp"
|
|
|
"github.com/coreos/etcd/etcdserver/api/v2http"
|
|
"github.com/coreos/etcd/etcdserver/api/v2http"
|
|
|
|
|
+ "github.com/coreos/etcd/etcdserver/api/v2v3"
|
|
|
|
|
+ "github.com/coreos/etcd/etcdserver/api/v3client"
|
|
|
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
|
"github.com/coreos/etcd/etcdserver/api/v3rpc"
|
|
|
"github.com/coreos/etcd/pkg/cors"
|
|
"github.com/coreos/etcd/pkg/cors"
|
|
|
"github.com/coreos/etcd/pkg/debugutil"
|
|
"github.com/coreos/etcd/pkg/debugutil"
|
|
@@ -409,7 +411,12 @@ func (e *Etcd) serve() (err error) {
|
|
|
// Start a client server goroutine for each listen address
|
|
// Start a client server goroutine for each listen address
|
|
|
var h http.Handler
|
|
var h http.Handler
|
|
|
if e.Config().EnableV2 {
|
|
if e.Config().EnableV2 {
|
|
|
- h = v2http.NewClientHandler(e.Server, e.Server.Cfg.ReqTimeout())
|
|
|
|
|
|
|
+ if len(e.Config().ExperimentalEnableV2V3) > 0 {
|
|
|
|
|
+ srv := v2v3.NewServer(v3client.New(e.Server), e.cfg.ExperimentalEnableV2V3)
|
|
|
|
|
+ h = v2http.NewClientHandler(srv, e.Server.Cfg.ReqTimeout())
|
|
|
|
|
+ } else {
|
|
|
|
|
+ h = v2http.NewClientHandler(e.Server, e.Server.Cfg.ReqTimeout())
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
mux := http.NewServeMux()
|
|
mux := http.NewServeMux()
|
|
|
etcdhttp.HandleBasic(mux, e.Server)
|
|
etcdhttp.HandleBasic(mux, e.Server)
|