functional-tester/agent: use "proxy.Server"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-04-05 10:54:53 -07:00
parent 7f812ca8e1
commit 9d3809646a
2 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@ import (
"time"
"github.com/coreos/etcd/pkg/fileutil"
"github.com/coreos/etcd/pkg/transport"
"github.com/coreos/etcd/pkg/proxy"
"github.com/coreos/etcd/tools/functional-tester/rpcpb"
"go.uber.org/zap"
@ -119,7 +119,7 @@ func (srv *Server) startProxy() error {
return err
}
srv.advertiseClientPortToProxy[advertiseClientURLPort] = transport.NewProxy(transport.ProxyConfig{
srv.advertiseClientPortToProxy[advertiseClientURLPort] = proxy.NewServer(proxy.ServerConfig{
Logger: srv.lg,
From: *advertiseClientURL,
To: *listenClientURL,
@ -142,7 +142,7 @@ func (srv *Server) startProxy() error {
return err
}
srv.advertisePeerPortToProxy[advertisePeerURLPort] = transport.NewProxy(transport.ProxyConfig{
srv.advertisePeerPortToProxy[advertisePeerURLPort] = proxy.NewServer(proxy.ServerConfig{
Logger: srv.lg,
From: *advertisePeerURL,
To: *listenPeerURL,
@ -176,7 +176,7 @@ func (srv *Server) stopProxy() {
zap.String("to", px.To()),
)
}
srv.advertiseClientPortToProxy = make(map[int]transport.Proxy)
srv.advertiseClientPortToProxy = make(map[int]proxy.Server)
}
if srv.Member.EtcdPeerProxy && len(srv.advertisePeerPortToProxy) > 0 {
for port, px := range srv.advertisePeerPortToProxy {
@ -196,7 +196,7 @@ func (srv *Server) stopProxy() {
zap.String("to", px.To()),
)
}
srv.advertisePeerPortToProxy = make(map[int]transport.Proxy)
srv.advertisePeerPortToProxy = make(map[int]proxy.Server)
}
}

View File

@ -21,7 +21,7 @@ import (
"os/exec"
"strings"
"github.com/coreos/etcd/pkg/transport"
"github.com/coreos/etcd/pkg/proxy"
"github.com/coreos/etcd/tools/functional-tester/rpcpb"
"go.uber.org/zap"
@ -50,8 +50,8 @@ type Server struct {
etcdLogFile *os.File
// forward incoming advertise URLs traffic to listen URLs
advertiseClientPortToProxy map[int]transport.Proxy
advertisePeerPortToProxy map[int]transport.Proxy
advertiseClientPortToProxy map[int]proxy.Server
advertisePeerPortToProxy map[int]proxy.Server
}
// NewServer returns a new agent server.
@ -65,8 +65,8 @@ func NewServer(
network: network,
address: address,
last: rpcpb.Operation_NotStarted,
advertiseClientPortToProxy: make(map[int]transport.Proxy),
advertisePeerPortToProxy: make(map[int]transport.Proxy),
advertiseClientPortToProxy: make(map[int]proxy.Server),
advertisePeerPortToProxy: make(map[int]proxy.Server),
}
}