Skip to content

Commit

Permalink
clientv3: fix grpc-go(v1.27.0) incompatible changes to balancer/resol…
Browse files Browse the repository at this point in the history
…ver.
  • Loading branch information
eddycjy authored and gdbelvin committed May 11, 2020
1 parent 2333747 commit d628792
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clientv3/balancer/picker/err.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ func (ep *errPicker) String() string {
return ep.p.String()
}

func (ep *errPicker) Pick(context.Context, balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) {
func (ep *errPicker) Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) {
return nil, nil, ep.err
}
2 changes: 1 addition & 1 deletion clientv3/balancer/picker/roundrobin_balanced.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type rrBalanced struct {
func (rb *rrBalanced) String() string { return rb.p.String() }

// Pick is called for every client request.
func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) {
func (rb *rrBalanced) Pick(ctx context.Context, opts balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) {
rb.mu.RLock()
n := len(rb.scs)
rb.mu.RUnlock()
Expand Down
4 changes: 2 additions & 2 deletions clientv3/balancer/resolver/endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (e *ResolverGroup) Close() {
}

// Build creates or reuses an etcd resolver for the etcd cluster name identified by the authority part of the target.
func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOption) (resolver.Resolver, error) {
func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) {
if len(target.Authority) < 1 {
return nil, fmt.Errorf("'etcd' target scheme requires non-empty authority identifying etcd cluster being routed to")
}
Expand Down Expand Up @@ -179,7 +179,7 @@ func epsToAddrs(eps ...string) (addrs []resolver.Address) {
return addrs
}

func (*Resolver) ResolveNow(o resolver.ResolveNowOption) {}
func (*Resolver) ResolveNow(o resolver.ResolveNowOptions) {}

func (r *Resolver) Close() {
es, err := bldr.getResolverGroup(r.endpointID)
Expand Down

0 comments on commit d628792

Please sign in to comment.