Skip to content

Commit

Permalink
tests: Make EtcdServerProcess substruct of proxyEtcdProcess to copyin…
Browse files Browse the repository at this point in the history
…g methods when extending EtcdProcess interface

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
  • Loading branch information
serathius committed Jul 27, 2023
1 parent 6aad508 commit bdde41b
Showing 1 changed file with 4 additions and 31 deletions.
35 changes: 4 additions & 31 deletions tests/framework/e2e/cluster_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ import (
"go.uber.org/zap"

"go.etcd.io/etcd/pkg/v3/expect"
"go.etcd.io/etcd/pkg/v3/proxy"
"go.etcd.io/etcd/tests/v3/framework/config"
)

type proxyEtcdProcess struct {
etcdProc EtcdProcess
*EtcdServerProcess
// TODO(ahrtr): We need to remove `proxyV2` and v2discovery when the v2client is removed.
proxyV2 *proxyV2Proc
proxyV3 *proxyV3Proc
Expand All @@ -49,15 +48,13 @@ func NewProxyEtcdProcess(cfg *EtcdServerProcessConfig) (*proxyEtcdProcess, error
return nil, err
}
pep := &proxyEtcdProcess{
etcdProc: ep,
proxyV2: newProxyV2Proc(cfg),
proxyV3: newProxyV3Proc(cfg),
EtcdProcess: ep,
proxyV2: newProxyV2Proc(cfg),
proxyV3: newProxyV3Proc(cfg),
}
return pep, nil
}

func (p *proxyEtcdProcess) Config() *EtcdServerProcessConfig { return p.etcdProc.Config() }

func (p *proxyEtcdProcess) EndpointsHTTP() []string { return p.proxyV2.endpoints() }
func (p *proxyEtcdProcess) EndpointsGRPC() []string { return p.proxyV3.endpoints() }
func (p *proxyEtcdProcess) EndpointsMetrics() []string {
Expand Down Expand Up @@ -108,30 +105,6 @@ func (p *proxyEtcdProcess) Etcdctl(opts ...config.ClientOption) *EtcdctlV3 {
return etcdctl
}

func (p *proxyEtcdProcess) Logs() LogsExpect {
return p.etcdProc.Logs()
}

func (p *proxyEtcdProcess) Kill() error {
return p.etcdProc.Kill()
}

func (p *proxyEtcdProcess) IsRunning() bool {
return p.etcdProc.IsRunning()
}

func (p *proxyEtcdProcess) Wait(ctx context.Context) error {
return p.etcdProc.Wait(ctx)
}

func (p *proxyEtcdProcess) PeerProxy() proxy.Server {
return nil
}

func (p *proxyEtcdProcess) Failpoints() *BinaryFailpoints {
return p.etcdProc.Failpoints()
}

type proxyProc struct {
lg *zap.Logger
name string
Expand Down

0 comments on commit bdde41b

Please sign in to comment.