Commit Graph

132 Commits (129138760cbb79bc183abf6652455d27d6748818)

Author SHA1 Message Date
vimalk78 7f47de8414 clientv3: add nil checks in Close()
Added nil checks in Close() for Watcher and Lease fields
Added test case
2019-08-21 23:04:42 +01:00
Gyuho Lee 97fd40c587 clientv3: use Endpoints(), fix context creation
If overwritten, the previous context should be canceled first.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-12 21:39:50 -07:00
Gyuho Lee 9b385737f5 clientv3: deprecate "grpc.ErrClientConnClosing"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-05 13:27:16 -07:00
Gyuho Lee 8c7c6ec0c1 clientv3/balancer: refactor
refactor + remove unused

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 09:19:19 -07:00
Gyuho Lee 3dc00ab615 clientv3: move auth token credential to "credentials" package
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 09:17:44 -07:00
Gyuho Lee db7231accc clientv3: use new "credentials" package
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 08:56:33 -07:00
Gyuho Lee 12ab2ee3c4 clientv3: do not use pointer to TransportCredentials interface
Interface in Go is already reference

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 08:52:31 -07:00
Gyuho Lee 1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
Gyuho Lee e899023f3f
Merge pull request #10640 from shrajfr12/gomodulecompat
Fix module path to have the major version to comply with go modules specification.
2019-05-01 22:46:03 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
johncming 9b5c468dc6 clientv3: modify lock type. 2019-03-29 21:02:13 +08:00
johncming 662fd55084 clientv3: clean up unused code. 2019-03-18 10:34:41 +08:00
Gyuho Lee 4f46b65748 clientv3: use default info level log configuration
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-02-21 10:57:38 -08:00
cfc4n a033686acf clientv3/integration: return err if err == rpctypes.ErrAuthNotEnable 2019-02-02 14:06:54 +08:00
Gyuho Lee 61218004c0 clientv3: remove "JitterUp" imports
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-01-03 11:00:45 -08:00
Philipp Gillé 0cfc01b873 clientv3: Fix spelling in comment 2018-11-12 22:33:48 +01:00
Joe Betz 6a43db1eff
clientv3: Fix concurrent clientv3 client creation in 3.4 by using proper UUIDs 2018-10-22 14:08:58 -07:00
Sahdev P. Zala f6f375109e clientv3: let etcd client use all available keepalive ClientParams
We should allow etcd client use all of the available keepalive
client parameters as documented in this link,
https://godoc.org/google.golang.org/grpc/keepalive#ClientParameters
Currently in the etcd, by default PermitWithoutStream is set to
false, and user has no way to override it.
On the server side, we explicitely setting EnforcementPolicy
PermitWithoutStream to false and don't provide option to override it
to user but on the client side we should allow this option as
provided by the grpc.
2018-10-02 15:51:27 -04:00
Gyuho Lee 0ef9ef3c74 *: rerun "gofmt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 18:25:39 -07:00
Gyuho Lee 2ac04381a2 clientv3: update Go import paths to "go.etcd.io"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Joe Betz 67bcf28c4e
clientv3: Use passthrough resolver for direct endpoint dialing 2018-07-27 10:15:02 -07:00
Joe Betz b3b06a862a
clientv3: Fix maintenance APIs to directly dial grpc endpoints correctly. 2018-07-23 11:20:15 -07:00
Joe Betz 8451a1715f clientv3: Enable balancer logging if ETCD_CLIENT_DEBUG environment variable is set 2018-06-15 16:28:36 -07:00
Gyuho Lee 6e521d2f3f clientv3: add "IsConnCanceled", deprecate "grpc.ErrClientConnClosing"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 14:47:08 -07:00
Gyuho Lee a76681073d clientv3: add "zap.Config" to replace global logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00
Gyuho Lee dd520cebd4 clientv3: put "defaultCallOpts" back to "Client" object
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00
Joe Betz a5b2fb5563 clientv3: Introduce custom retry interceptor based on go-grpc-middleware/retry 2018-06-15 13:41:28 -07:00
Gyuho Lee 4065735845 clientv3: remove unused "dialerrc"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00
Joe Betz 8569b9c782 clientv3: Fix endpoint resolver to create a new resolver for each grpc client connection 2018-06-15 13:41:28 -07:00
Joe Betz 9304d1abd1 clientv3: Fix TLS test failures by returning DeadlineExceeded error from dial without any additional wrapping 2018-06-15 13:41:28 -07:00
Joe Betz ee2747eba8 clientv3: Fix dial calls to consistently use endpoint resolver, attempt to deflake alarm test 2018-06-15 13:41:28 -07:00
Joe Betz f84f554301 clientv3: Fix auth client to use endpoints instead of host when dialing, fix tests to block on dial when required. 2018-06-15 13:41:28 -07:00
Gyuho Lee bb032f3e5f clientv3: deprecate "grpc.WithTimeout" in favor of "grpc.DialContext"
"grpc.WithTimeout" dial option is being deprecated.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:41:28 -07:00
Joe Betz 7ac2a2dd20 clientv3: Fix dialer for new balancer to correctly handle first are as endpoint, not hostname 2018-06-15 13:41:28 -07:00
Joe Betz 309208dbef clientv3: Split out grpc balancer builder to ensure there is a balancer per ClientConn 2018-06-15 13:41:28 -07:00
Joe Betz f20a1173d8 clientv3: Fix new load balancer integration issues 2018-06-15 13:41:28 -07:00
Joe Betz 6080fa1270 clientv3: Integrate new grpc load balancer interface with etcd client 2018-06-15 13:41:28 -07:00
Jordan Liggitt d1579c95a2
clientv3: backoff on reestablishing watches when Unavailable errors are encountered 2018-06-13 02:05:04 -04:00
jiaxuanzhou ad448fb280 clientv3: keep NewFromURL the same, add method NewFromURLs 2018-03-27 10:40:10 +08:00
jiaxuanzhou e1bf612ee8 clientv3: optimize func NewFromURL 2018-03-27 09:30:12 +08:00
Hitoshi Mitake b0ed5c1dd8
Merge pull request #8680 from mitake/auth-cleanup
*: don't use a string literal directly in grpc metadata
2018-03-20 18:19:23 +09:00
Gyuho Lee 3aa5711dca clientv3: move health balancer to "balancer"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-19 15:16:11 -07:00
Hitoshi Mitake b1dd19a7aa *: don't use string literals directly in grpc metadata
Current etcd code uses the string literals ("token", "authorization")
as field names of grpc and swappger metadata for passing token. It is
difficult to maintain so this commit introduces new constants for the
purpose.
2018-03-15 14:17:34 +09:00
Gyuho Lee 1f016f3b96 clientv3: use "pkg/logger"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-05 13:40:58 -08:00
Sahdev P. Zala 3b7e2ce0ca StatusFromError: handle return value of the function
status.FromError can return nil, false. We are handling the return values
most places in code but some places we aren't. Fixing it herewith.

Fixes #9117
2018-01-08 22:28:20 -05:00
Gyuho Lee 497412c588 clientv3: call other APIs with default gRPC call options
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 10:58:05 -08:00
Gyuho Lee 63d66b1011 clientv3: configure gRPC message limits in Config
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 10:58:01 -08:00
Manjunath A Kumatagi 18746c65da Clientv3: Fix govet error for gotip 2017-12-15 14:31:27 +05:30
Gyu-Ho Lee 75110dd839 *: fix naked returns
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 18:46:15 -08:00