399 Commits

Author SHA1 Message Date
Marek Siarkowicz
19002cfc68 version: bump up to 3.5.5 2022-09-15 14:02:30 +02:00
Benjamin Wang
9ea5b1ba22 Refactor the keepAliveListener and keepAliveConn
Only `net.TCPConn` supports `SetKeepAlive` and `SetKeepAlivePeriod`
by default, so if you want to warp multiple layers of net.Listener,
the `keepaliveListener` should be the one which is closest to the
original `net.Listener` implementation, namely `TCPListener`.

Also refer to https://github.com/etcd-io/etcd/pull/14356

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-08-20 15:03:15 +08:00
Justin Kolberg
eab0b999a8
clientv3: close streams after use in lessor keepAliveOnce method
Streams are now closed after being used in the lessor `keepAliveOnce` method.
This prevents the "failed to receive lease keepalive request from gRPC stream"
message from being logged by the server after the context is cancelled by the
client.

Signed-off-by: Justin Kolberg <amd.prophet@gmail.com>
2022-08-18 09:54:12 -07:00
Benjamin Wang
2751c61f24 update all related dependencies
Upgrade grpc to 1.41.0;
Run ./script/fix.sh to fix all related issue.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-08-07 07:17:27 +08:00
Jille Timmermans
cbedaf90fe Improve error message for incorrect values of ETCD_CLIENT_DEBUG
Signed-off-by: Jille Timmermans <jille@quis.cx>
2022-07-14 09:43:54 +02:00
Sahdev Zala
4df61af2df Client: fix check for WithPrefix op
Make sure that WithPrefix correctly set the flag, and add test.
Also, add test for WithFromKey.

fixes #14056

Signed-off-by: Sahdev Zala <spzala@us.ibm.com>
2022-07-02 23:33:26 -04:00
Benjamin Wang
df632abd8a client/v3: do not overwrite authTokenBundle on dial
Cherry pick the PR https://github.com/etcd-io/etcd/pull/12992
to 3.5, so please refer to the original PR for more detailed info.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-06-18 06:59:55 +08:00
Benjamin Wang
db0b67e8a0 Add FileReader and FileBufReader utilities
The FileReader interface is the wrapper of io.Reader. It provides
the fs.FileInfo as well. The FileBufReader struct is the wrapper of
bufio.Reader, it also provides fs.FileInfo.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-06-17 09:00:43 +08:00
Marek Siarkowicz
08407ff760 version: bump up to 3.5.4 2022-04-24 12:44:36 +02:00
Jordan Liggitt
081b4e2a0f Add unit test for canonical SRV records 2022-04-15 15:33:31 -04:00
Jordan Liggitt
76564778a9 Revert "trim the suffix dot from the srv.Target for etcd-client DNS lookup"
This reverts commit 4f51cc1d9a6d31ae5622fe50c90f03962a7ee3a4.
2022-04-15 15:33:16 -04:00
Marek Siarkowicz
0452feec71 version: bump up to 3.5.3 2022-04-13 17:17:51 +02:00
Danielle Lancashire
5d44f2242f cv3/mirror: Fetch the most recent prefix revision
When a user sets up a Mirror with a restricted user that doesn't have
access to the `foo` path, we will fail to get the most recent revision
due to permissions issues.

With this change, when a prefix is provided we will get the initial
revision from the prefix rather than /foo. This allows restricted users
to setup sync.
2022-04-13 12:39:06 +00:00
Chris Ayoub
232fb980a7 clientv3: filter learners members during autosync
This change is to ensure that all members returned during the client's
AutoSync are started and are not learners, which are not valid
etcd members to make requests to.
2022-04-09 21:25:42 -04:00
Marek Siarkowicz
238b18c110
Merge pull request #13895 from mrueg/rel3.5-client_golang
[release-3.5] go.mod: Upgrade to prometheus/client_golang v1.11.1
2022-04-07 09:38:43 +02:00
Manuel Rüger
3b8c6512df go.mod: Upgrade to prometheus/client_golang v1.11.1 2022-04-06 00:35:48 +02:00
Marek Siarkowicz
a060b42e47 server: Use default logging configuration instead of zap production one
This fixes problem where logs json changes format of timestamp.
2022-04-01 12:23:44 +02:00
leoyang.yl
7cec92a281 *: fix IsOptsWithFromKey
porting back from 3.5 from main
PR #13334
2022-02-23 16:42:00 -08:00
ahrtr
4f51cc1d9a trim the suffix dot from the srv.Target for etcd-client DNS lookup 2022-02-19 05:55:19 +08:00
Marek Siarkowicz
99018a77be version: bump up to 3.5.2 2022-02-01 12:28:34 +01:00
Piotr Tabor
74f33d6665 Update dep: require gopkg.in/yaml.v2 v2.2.8 -> v2.4.0 due to: CVE-2019-11254. 2022-01-17 17:10:50 +01:00
Hitoshi Mitake
dec6f72d68 *: implement a retry logic for auth old revision in the client 2021-11-15 00:09:16 +09:00
Ashish Ranjan
79bbc8fdb7 client/v3: refresh the token when ErrUserEmpty is received while retrying
To fix a bug in the retry logic caused when the auth token is cleared after receiving `ErrInvalidAuthToken` from the server and the subsequent call to `getToken` also fails due to some reason (eg. context deadline exceeded).
This leaves the client without a token and the retry will continue to fail with `ErrUserEmpty` unless the token is refreshed.
2021-11-15 00:09:09 +09:00
Sam Batschelet
d42e8589e1 version: 3.5.1
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-10-03 11:47:37 -04:00
Marek Siarkowicz
79f9a45574 client: Use first endpoint as http2 authority header 2021-09-30 12:15:33 +02:00
Sam Batschelet
946a5a6f25 version: 3.5.0
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-15 17:34:52 -04:00
Sam Batschelet
8139dd3e55 version: 3.5.0-rc.1
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-09 17:57:52 -04:00
Lili Cosic
9fee8bf95e Update client_golang dependency to v1.11.0 2021-06-07 15:54:57 +02:00
Sam Batschelet
ab20aa29a0 version: 3.5.0-rc.0
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-03 21:39:37 -04:00
Piotr Tabor
a5523be415 Update of dependencies:
- zap-1.17.0
  - bbolt-1.3.6
  - grpc -1.38
  - github.com/coreos/go-systemd/v22 v22.3.2
  - github.com/google/btree v1.0.1
  - github.com/json-iterator/go v1.1.11
2021-06-03 15:19:33 +02:00
Sam Batschelet
6cd7c02873
Merge pull request #13055 from ptabor/20210528-beckport-integration-fixes 2021-05-30 16:35:15 -04:00
Piotr Tabor
3f13d3a2d5 integration.BeforeTest can be run without leak-detection. 2021-05-28 10:01:36 +02:00
Piotr Tabor
4af7fc393c Expose clientv3.CreateDefaultZapLoggerConfig
Need raised in
f3f4259d3f.

BTW: Alligned the implementation of grpclogs with what we use in embed server, so reduced the client code dependencies.
2021-05-26 12:52:46 +02:00
Sam Batschelet
b3f16d6691 version: 3.5.0-beta.4
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-05-25 20:48:48 -04:00
Sam Batschelet
379c361bc6 version: 3.5.0-beta.3
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-05-18 09:44:35 -04:00
Sam Batschelet
1a8a063a31 version: 3.5.0-beta.2
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-05-18 06:32:19 -04:00
Piotr Tabor
8981afb6f5 Fix unit tests logging config. 2021-05-14 22:45:57 +02:00
Piotr Tabor
f5c26814ab Loggers to catch the e2e flake. 2021-05-14 22:42:31 +02:00
Gyuho Lee
e2d67f2e3b
Merge pull request #12956 from gyuho/rename-to-main
*: rename "master" branch references to "main" in source code
2021-05-13 08:26:33 -07:00
Gyuho Lee
a8e1cf0433 client: rename "master" branch references to "main"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2021-05-12 10:38:50 -07:00
Marek Siarkowicz
1189ee3f3d client: Add logger argument to NewCtxClient 2021-05-12 16:40:55 +02:00
Piotr Tabor
1929aa0a36
Merge pull request #12948 from serathius/logger
client: Allow setting zap logger in config
2021-05-12 13:49:48 +02:00
Marek Siarkowicz
06afe87b34 client: Allow setting zap logger in config 2021-05-12 12:15:20 +02:00
Piotr Tabor
3b24496c2a
Merge pull request #12925 from yangxuanjia/yxjetcd_check_resuming
check resuming len to avoid panic
2021-05-12 09:18:40 +02:00
yangxuanjia
68b1e9f728 check resuming len to avoid panic 2021-05-12 09:51:59 +08:00
Lili Cosic
1a718a958e Add initial Tracing with OpenTelemetry 2021-05-10 10:44:40 +02:00
刘兵
a8a3eea56d
fix doc demo bug
the service parameter not used.
2021-05-05 13:57:10 +08:00
Piotr Tabor
451f65d661
Merge pull request #12908 from ptabor/20210429-client-retry-logging
Clientv3 (retry interceptor) logs should use the configured logger
2021-04-29 19:25:04 +02:00
Piotr Tabor
ffea1537d4 ClientV3 tests use integration.NewClient that configures proper logger. 2021-04-29 18:18:34 +02:00
Piotr Tabor
bc8d3f6639 Clientv3 (retry) logs should use the configured logger.
clientv3 logs (especially tests) were poluted with unattributed to testing.T log lines:

```
{"level":"warn","ts":"2021-04-29T12:42:11.055+0200","logger":"etcd-client","caller":"v3/retry_interceptor.go:64","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0000fafc0/#initially=[unix://localhost:m10]","attempt":0,"error":"rpc error: code = ResourceExhausted desc = etcdserver: mvcc: database space exceeded"}
```

The reasons were 2 fold:
  - Interceptors were copying logger before "WithLogger" could modify it.
  - We were not propagating the loggers in a few testing contexts.
2021-04-29 12:57:09 +02:00