Skip to content

Commit a8c84ff

Browse files
committed
clientv3: fix client balancer with gRPC v1.7
Signed-off-by: Gyu-Ho Lee <[email protected]>
1 parent 939337f commit a8c84ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2351
-960
lines changed

clientv3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# etcd/clientv3
22

3-
[![Godoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/coreos/etcd/clientv3)
3+
[![Godoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/coreos/etcd/clientv3)
44

55
`etcd/clientv3` is the official Go etcd client for v3.
66

clientv3/auth.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020

2121
"github.com/coreos/etcd/auth/authpb"
2222
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
23+
2324
"golang.org/x/net/context"
2425
"google.golang.org/grpc"
2526
)
@@ -104,16 +105,16 @@ type auth struct {
104105
}
105106

106107
func NewAuth(c *Client) Auth {
107-
return &auth{remote: pb.NewAuthClient(c.ActiveConnection())}
108+
return &auth{remote: RetryAuthClient(c)}
108109
}
109110

110111
func (auth *auth) AuthEnable(ctx context.Context) (*AuthEnableResponse, error) {
111-
resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{}, grpc.FailFast(false))
112+
resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{})
112113
return (*AuthEnableResponse)(resp), toErr(ctx, err)
113114
}
114115

115116
func (auth *auth) AuthDisable(ctx context.Context) (*AuthDisableResponse, error) {
116-
resp, err := auth.remote.AuthDisable(ctx, &pb.AuthDisableRequest{}, grpc.FailFast(false))
117+
resp, err := auth.remote.AuthDisable(ctx, &pb.AuthDisableRequest{})
117118
return (*AuthDisableResponse)(resp), toErr(ctx, err)
118119
}
119120

@@ -138,12 +139,12 @@ func (auth *auth) UserGrantRole(ctx context.Context, user string, role string) (
138139
}
139140

140141
func (auth *auth) UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) {
141-
resp, err := auth.remote.UserGet(ctx, &pb.AuthUserGetRequest{Name: name}, grpc.FailFast(false))
142+
resp, err := auth.remote.UserGet(ctx, &pb.AuthUserGetRequest{Name: name})
142143
return (*AuthUserGetResponse)(resp), toErr(ctx, err)
143144
}
144145

145146
func (auth *auth) UserList(ctx context.Context) (*AuthUserListResponse, error) {
146-
resp, err := auth.remote.UserList(ctx, &pb.AuthUserListRequest{}, grpc.FailFast(false))
147+
resp, err := auth.remote.UserList(ctx, &pb.AuthUserListRequest{})
147148
return (*AuthUserListResponse)(resp), toErr(ctx, err)
148149
}
149150

@@ -168,12 +169,12 @@ func (auth *auth) RoleGrantPermission(ctx context.Context, name string, key, ran
168169
}
169170

170171
func (auth *auth) RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) {
171-
resp, err := auth.remote.RoleGet(ctx, &pb.AuthRoleGetRequest{Role: role}, grpc.FailFast(false))
172+
resp, err := auth.remote.RoleGet(ctx, &pb.AuthRoleGetRequest{Role: role})
172173
return (*AuthRoleGetResponse)(resp), toErr(ctx, err)
173174
}
174175

175176
func (auth *auth) RoleList(ctx context.Context) (*AuthRoleListResponse, error) {
176-
resp, err := auth.remote.RoleList(ctx, &pb.AuthRoleListRequest{}, grpc.FailFast(false))
177+
resp, err := auth.remote.RoleList(ctx, &pb.AuthRoleListRequest{})
177178
return (*AuthRoleListResponse)(resp), toErr(ctx, err)
178179
}
179180

@@ -201,7 +202,7 @@ type authenticator struct {
201202
}
202203

203204
func (auth *authenticator) authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) {
204-
resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, grpc.FailFast(false))
205+
resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password})
205206
return (*AuthenticateResponse)(resp), toErr(ctx, err)
206207
}
207208

0 commit comments

Comments
 (0)