embed: serve lock api
@@ -25,6 +25,9 @@ import (
"time"
"github.com/coreos/etcd/etcdserver"
+ "github.com/coreos/etcd/etcdserver/api/v3client"
+ "github.com/coreos/etcd/etcdserver/api/v3lock"
+ "github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb"
"github.com/coreos/etcd/etcdserver/api/v3rpc"
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/pkg/transport"
@@ -68,6 +71,7 @@ func (sctx *serveCtx) serve(s *etcdserver.EtcdServer, tlscfg *tls.Config, handle
if sctx.insecure {
gs := v3rpc.Server(s, nil)
+ v3lockpb.RegisterLockServer(gs, v3lock.NewLockServer(v3client.New(s)))
if sctx.serviceRegister != nil {
sctx.serviceRegister(gs)
}
@@ -95,6 +99,7 @@ func (sctx *serveCtx) serve(s *etcdserver.EtcdServer, tlscfg *tls.Config, handle
if sctx.secure {
gs := v3rpc.Server(s, tlscfg)
+ v3lockpb.RegisterLockServer(gs, v3lock.NewLockServer(v3client.New(s)))
if sctx.serviceRegister != nil {
sctx.serviceRegister(gs)
}
