etcdserver, clientv3: handle a case of expired auth token
This commit adds a mechanism of handling a case of expired auth token to clientv3. If a server returns an error code grpc.codes.Unauthenticated, newRetryWrapper() tries to get a new token and use it as an option of PerRPCCredential. Fixes https://github.com/coreos/etcd/issues/7012
This commit is contained in:

committed by
Hitoshi Mitake

parent
b32a8010a7
commit
d431b64d97
@ -93,6 +93,8 @@ func togRPCError(err error) error {
|
||||
return rpctypes.ErrGRPCPermissionNotGranted
|
||||
case auth.ErrAuthNotEnabled:
|
||||
return rpctypes.ErrGRPCAuthNotEnabled
|
||||
case etcdserver.ErrInvalidAuthToken:
|
||||
return rpctypes.ErrGRPCInvalidAuthToken
|
||||
default:
|
||||
return grpc.Errorf(codes.Unknown, err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user