Commit Graph

447 Commits (061d8e8ead3107a230548a66ec3a24d343e446ad)

Author SHA1 Message Date
Piotr Tabor de55bb6331 pkg: Rename imports after making 'pkg' a module
find -name '*.go' | xargs sed --follow-symlinks -i 's|go.etcd.io/etcd/v3/pkg/|go.etcd.io/etcd/pkg/v3/|g'
go fmt ./...
2020-10-13 00:09:27 +02:00
Piotr Tabor 28f2b07623 *: Update references to code moved to the api/ dir.
Follow up to file-moves done in the previous commit.

The commit contains purely mechanical consequences of execution (apart
of scripts/genproto.sh):

  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/v3rpc/rpctypes|v3/api/v3rpc/rpctypes|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/version|v3/api/version|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/mvcc/mvccpb|v3/api/mvccpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/etcdserverpb|v3/api/etcdserverpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/membership/membershippb|v3/api/membershippb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/auth/authpb|v3/api/authpb|g'

  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/mvcc/mvccpb/kv.proto|/api/mvccpb/kv.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/auth/authpb/auth.proto|/api/authpb/auth.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/etcdserver/api/membership/membershippb/membership.proto|/api/membershippb/membership.proto|g'

  I also modified manually paths in scripts/genproto.sh.

  % go fmt ./...
2020-10-06 11:56:16 +02:00
Piotr Tabor 73e5714bc5
integration: 'go test -tags cluster_proxy -v ./integration/... ./clientv3/...' passes now. (#12319)
The grpc-proxy test logic was assuming that the context associated to client is closed,
while in practice all tests called client.Close() without explicit context close.

The current testing strategy is complicated 2 fold:
  - grpc proxy works like man-in-the middle of each Connection issues
from integration tests and its lifetime is bound to the connection.
  - both connections (client -> proxy, and proxy -> etcd-server) are
represented by the same ClientV3 object instance (with substituted
implementations of KV or watcher).

The fix splits context representing proxy from context representing proxy -> etcd-server connection,
thus allowing cancelation of the proxy context.
2020-09-25 12:18:58 -07:00
Sahdev P. Zala c7458015d3 config: grpc gateway
Currently, the grpc gateway is enabled by default when run the etcd server
using command line configuration. However, when provide config through
config file, the grpc gateway is disabled by default. We should either use
the same approach or at least document this.

related #https://github.com/etcd-io/etcd/issues/12093
2020-09-14 09:49:53 -04:00
Joe Betz 76e769ce95
Merge pull request #12273 from ptabor/2020-09-07-fix-grpc-proxy-tests
testing/e2e,grpcproxy: Fix: go test --tags "cluster_proxy" -v ./tests/e2e/...
2020-09-09 12:03:09 -07:00
Piotr Tabor 9d5a840942 etcdmain/grpc_proxy: Remove superflous logging line. 2020-09-09 20:04:25 +02:00
Piotr Tabor c32180d772 tests/e2e,etcdctl,etcdmain: Fix go test --tags cov -v ./tests/e2e
This CL fixes:
  COVERDIR=./coverage PASSES="build_cov" && go test --tags cov -v ./tests/e2e
and is part of the effort to make:
  COVERDIR=coverage PASSES="build_cov cov" ./test
fully pass.

The args passed to ./bin/etcd_test and ./bin/etcdctl_test binaries were
mismatched. The protocol of passing the arguments using
environment variables has been replaces with proper passing of flags.

How the measurement of coverage by e2e tests works:
  1. COVERDIR=./coverage PASSES="build_cov" are generating
./bin/etcd_test and ./bin/etcdctl_test binaries.

  2. These binaries are tests (as coverage can be computed only for
tests) [see ./main_test.go ./etcdctl/main_test.go], but this tests are
running the main logic of the server and uppon termination (or SIGTERM
signal) are writting proper .coverprofile files in the $COVERDIR folder.
The binaries used to take arguments using env variables, but its not
needed any longer. The binaries can consume any command line arguments
that either test (so --test.fooo) or the original binary can consume.

 3.  The tests/e2e (when compiled with the --tags cov) are starting the
_test binaries instead of the original binaries, such that the coverage
is being collected.
2020-09-09 12:56:15 +02:00
Piotr Tabor 2d0ce9de3d etcdmain: grpc-proxy should only require CN-less certificates for --cert flags.
We have following communication schema:
client --- 1 ---> grpc-proxy --- 2 --- > etcd-server

There are 2 sets of flags/certs in grpc proxy [ https://github.com/etcd-io/etcd/blob/master/etcdmain/grpc_proxy.go#L140 ]:
 A. (cert-file, key-file, trusted-ca-file, auto-tls) this are controlling [1] so client to proxy connection and in particular they are describing proxy public identity.
 B. (cert,key, cacert ) - these are controlling [2] so what's the identity that proxy uses to make connections to the etcd-server.

If 2 (B.) contains certificate with CN and etcd-server is running with --client-cert-auth=true, the CN can be used as identity of 'client' from service perspective. This is permission escalation, that we should forbid.

If 1 (A.) contains certificate with CN - it should be considered perfectly valid. The server can (should) have full identity.

So only --cert flag (and not --cert-file flag) should be validated for empty CN.
2020-09-07 11:59:28 +02:00
jingyih 9a698476bf *: add experimental flag for watch notify interval 2020-08-14 12:01:00 -07:00
tangcong 0898c5b978 *: add health check for grpcproxy self 2020-07-10 20:17:44 +08:00
Gyuho Lee 58bb8ae09f
Merge pull request #12018 from spzala/umaskconsideration
pkg: consider umask when use MkdirAll
2020-07-06 17:33:33 -07:00
Gyuho Lee 27ddb84268
Merge pull request #12107 from tangcong/register-grpcproxy-metrics
*: register metrics handler for grpcproxy self
2020-07-06 13:00:35 -07:00
tangcong fff5d3cc03 *: register metrics handler for grpcproxy self 2020-07-02 22:55:18 +08:00
Hitoshi Mitake db2165dfb1 etcdmain: let grpc proxy warn about insecure-skip-tls-verify 2020-06-29 23:37:04 +09:00
tangcong a08c52945f etcdmain: fix shadow error 2020-06-24 17:47:18 +08:00
Xiang Li beb5614aad
doc: add TLS related warnings (#12060) 2020-06-23 21:07:36 -07:00
Gyuho Lee 8f19fecb82
Merge pull request #12030 from tangcong/fix-grpc-proxy-hang
proxy/grpcproxy: fix grpc proxy hang when broadcast failed to cancel a watcher
2020-06-22 10:53:13 -07:00
tangcong 34e3dbe3d4 proxy/grpcproxy: add zap logger 2020-06-22 14:56:58 +08:00
Gyuho Lee ebdccedbde
Merge pull request #11980 from cfc4n/simple-token-ttl
auth: Customize the settings of simpleTokenTTL.
2020-06-21 23:23:45 -07:00
jingyih fac83fbecd CHANGELOG: update for PR11946
Also update helper message to include the new flag.
2020-06-20 12:26:36 -07:00
Sahdev P. Zala f5a85e9987 pkg: consider umask when use MkdirAll
os.MkdirAll creates directory before umask so make sure that a desired
permission is set after creating a directory with MkdirAll. Use the
existing TouchDirAll function which checks for permission if dir is already
exist and when create a new dir.
2020-06-20 13:10:11 -04:00
cfc4n d507ab4aad auth: Customize simpleTokenTTL settings.
see https://github.com/etcd-io/etcd/issues/11978 for more detail.
2020-06-11 17:15:42 +08:00
Sahdev Zala 84a5ff2d97
Merge pull request #11962 from spzala/incorrectflag
logging: create logger to prevent nil pointer
2020-06-09 14:34:22 -04:00
Sahdev P. Zala 659fb01a6c logging: create logger to prevent nil pointer
Create a new logger if one not found.
2020-06-02 09:53:35 -04:00
Gyuho Lee 09fcf55ca4
Merge pull request #11845 from xiang90/tcp_proxy
etcdmain: best effort detection of self pointing in tcp proxy
2020-05-31 00:57:49 -07:00
David Crawshaw 66cb045d47 etcdserver, et al: add --unsafe-no-fsync flag
This makes it possible to run an etcd node for testing and development
without placing lots of load on the file system.

Fixes #11930.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-05-26 09:21:49 +10:00
Xiang Li 16810cd211 etcdmain: best effort detection of self pointing in tcp proxy 2020-05-04 15:42:01 -07:00
Hitoshi Mitake c92691dc47 etcdctl, etcdmain: warn about --insecure-skip-tls-verify options 2020-05-03 17:17:30 +09:00
Brandon Philips 96cce208c2 go.mod: use go.etcd.io/etcd/v3 versioning
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
2020-04-28 00:57:35 +00:00
Sahdev Zala b40f18b506
pkg: check file stats (#11798)
modify file util.
2020-04-21 19:58:48 -07:00
mlmhl 0461b3fa51
grpcproxy: make grpc keep alive related options configurable (#11711)
Currently grpc-proxy doesn't config keep alive related options, so it
will use the default values provided by the underlay gprc library. If
clients uses a keep alive ping interval smaller than server's default
minTime, connections between server and clients will be closed and
reopened frequently.
2020-04-17 21:20:03 -07:00
zhangbitao 209102655b etcdmain: fix typo 2020-04-02 10:04:35 +08:00
Gyuho Lee 2329acf05b etcdmain: log "SdNotify" error/success
I am seeing some silent failures around systemd service.
This will help find out bugs in "go-systemd"

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-24 12:20:20 -07:00
Gyuho Lee 92f180c574 *: log server-side /health checks
To make it easier to root-cause when /health check fails.
For example, we are using load balancer to health check
each etcd instance, and when one etcd node gets terminated,
it's hard to tell whether etcd "server" was really failing
or client (or load balancer") failed to reach the etcd cluster
which is also failure in load balancer health check.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-18 11:14:05 -07:00
Jingyi Hu ae983523db
pkg: remove capnslog (#11616)
* pkg: remove capnslog

* CHANGELOG: function signature change
2020-02-12 11:15:41 -08:00
Jingyi Hu bb29615359
proxy: remove capnslog (#11614)
* proxy: remove capnslog

* CHANGELOG: function signature change
2020-02-12 10:30:09 -08:00
Jingyi Hu 0a05f1a131
etcdmain: remove capnslog (#11612) 2020-02-11 13:45:44 -08:00
Gyuho Lee aea3354854
Merge pull request #11548 from linux-on-ibm-z/s390x-docker
scripts: Added s390x support for docker image release
2020-02-06 11:13:16 -08:00
jingyih 725e09023a *: set zap as default logger, remove capnslog
Set zap as default logger. Remove capnslog and deprecated logging
flags.
2020-02-04 04:57:49 -08:00
Nirman Narang 17a220eaee scripts: Added s390x support for docker image release 2020-01-20 07:09:59 -08:00
poslua fd2dddb39f vendor: bump go-systemd to v22.0.0 to fix mod tidy error (#11387) 2019-12-04 18:47:14 -08:00
johncming 6c0e2d31fb etcdmain: remove duplicate codes. 2019-11-27 17:04:43 +08:00
宇慕 f62ea1ceca *: promote the boltdb-freelistType from experimental to official and set default type to hashmap 2019-10-17 15:40:38 +08:00
Sahdev P. Zala 27535517b1 pkg: handle version env variable
Version flag is meant for displaying version and it's a boolean.
It's for an internal use, and we may not want users to set
it in the environment.

Fixes # 11210
2019-10-13 13:23:59 -04:00
Jingyi Hu 20acacdea5 doc: clarify metrics flag 2019-09-24 15:27:46 -07:00
Jingyi Hu 871c2d716f etcdmain: update help message
Add experimental-peer-skip-client-san-verification flag description to
help message. Add default values.
2019-08-15 21:22:17 -07:00
Joe Betz 9b51febaf5 *: Add experimental-compaction-batch-limit flag 2019-08-15 11:47:23 -07:00
Martin Weindel 149e5dc291 etcdserver: mark flag as experimental, add to changelog and configuration 2019-07-30 16:57:57 -04:00
Martin Weindel 03fd396610 pkg/transport: Improved description of flag peer-skip-client-san-verification 2019-07-30 16:57:57 -04:00
Martin Weindel 1b048c91ec etcdserver: Added configuration flag --peer-skip-client-verify=true 2019-07-30 16:57:57 -04:00