Commit Graph

222 Commits (b7f0f52a16dbf83f18ca1d803f7892d750366a94)

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
teddylear 3b92b9f884 embed: TestStartEtcdWrongToken now uses dynamic ports instead of default
To avoid issues with a test failing due to port conflict when etcd is
already running, this test now uses dynamic ports instead.

Fixes #11956
2020-09-19 11:29:22 -04: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
jingyih 9a698476bf *: add experimental flag for watch notify interval 2020-08-14 12:01:00 -07:00
Gyuho Lee 7eac6bd497 *: upgrade zap logger to 1.15, replace global logger
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 09:50:00 -07:00
Gyuho Lee fe36be2251
Merge pull request #12195 from tangcong/optimize-healthcheck
*: check health by using v3 range request and its corresponding timeout
2020-08-11 21:32:44 -07:00
tangcong 25220a0287 *: check health by using v3 range request and its corresponding timeout 2020-08-04 00:34:18 +08:00
Jan Kuri 7f27697df9
v3client: implement clientv3.Auth interface (#12140) 2020-07-20 16:53:25 -07: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
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
Ankur Gargi 133b0c2b04
Use http constant instead of a number (#11975)
* embed: Use http constant instead of a number

* embed: Use http constant instead of a number

* embed: Replaced a number with Go http constant
2020-06-09 19:08:38 -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
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 1166b1f195
embed: fix compaction runtime err (#11787)
Handle negative value input which currently gives a runtime error.
2020-04-15 16:13:19 -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
Sahdev Zala e5c90ebf90
embed: don't compare uint to any negative number (#11603) 2020-02-10 14:16:57 -08:00
Jingyi Hu 74d5ba5777
embed: remove capnslog (#11592) 2020-02-05 10:22:32 -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
宇慕 f62ea1ceca *: promote the boltdb-freelistType from experimental to official and set default type to hashmap 2019-10-17 15:40:38 +08:00
chris e8660c0cec embed: expose ZapLoggerBuilder
This exposes the ZapLoggerBuilder in the embed.Config to allow for
custom loggers to be defined and used by embedded etcd.

Fixes #11144
2019-09-13 07:46:01 -04:00
Gyuho Lee ea0f08de20 embed: fix secure server logging message
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-09-03 08:56:32 -07:00
Gyuho Lee f22c7c80c1 embed: fix "--log-outputs" setup without "stderr"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-26 22:45:48 -07:00
Joe Betz 9b51febaf5 *: Add experimental-compaction-batch-limit flag 2019-08-15 11:47:23 -07:00
Gyuho Lee b9de4bddda embed: add "LogLevel", deprecate "Debug" in v3.5
Make log level configurable, and deprecate "debug" flag in v3.5.
And adds more warnings on flags that's being deprecated in v3.5.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-29 15:43:19 -07:00
Gyuho Lee 348b0d40a6 embed: do not expose "zapLoggerBuilder"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-29 15:43:19 -07:00
Gyuho Lee ecb915617d embed: disable v2 by default
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-28 19:36:51 -05:00
Gyuho Lee a6b105a907 embed: use new "credentials" package
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 08:56:45 -07:00
chris 2223142685 embed: fix oob panic in zap logger
This fixes an index out-of-bounds panic caused when using the embed
package and the zap logger. When a TLS handshake error is logged, the
slice for cert ip addresses is allocated with capacity but no length, so
subsequent index access causes the panic, and doesn't surface the TLS
handshake error to the user.

Fixes #10932
2019-07-25 09:42:42 -04:00
Jingyi Hu e67b9829b6 *: enable lease checkpoint via experimental flag
Primary lessor persist lease remainingTTL only if experimental flag
"--experimental-enable-lease-checkpoint" is set.
2019-06-05 15:30:03 -07:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
rohitsardesai83 42a7ea6d33 etcd: Replace ghodss/yaml with sigs.k8s.io/yaml
To remove the dependency on ghodss/yaml. Replaced this dependency with sigs.k8s.io/yaml.
This wil help to remove the ghodss/yaml dependency from main kubernetes repository.

xref: https://github.com/kubernetes/kubernetes/issues/77024
2019-05-02 12:34:36 +05:30
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Ben McIlwain b3dd3d3856 embed: Fix HTTPs -> HTTPS in error message 2019-04-17 09:38:53 -04:00
caoming 874532c2da embed: Modify the comments to be more precise. 2019-03-14 10:59:52 +08:00
Gyuho Lee 8d1a62e7ef *: use default log configuration for server
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-02-21 10:57:26 -08:00
WizardCXY e6c6d8492e *: add flag to let etcd use the new boltdb freelistType feature 2019-02-14 11:07:08 +08:00
Hitoshi Mitake 11fb62ecb4 embed: requests for grpc gateway must have empty CN if --client-cert-auth is passed
This commit lets grpc gateway return a correct error to clients.

Even if a client has a cert with non empty CN, current gateway returns
an error like below:
```
$ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}'
{"error":"etcdserver: user name is empty","code":3}
```
This is because etcd ignores CN from gateway connection.

The error will be like this:
```
$ curl --cacert ./integration/fixtures/ca.crt --cert ./integration/fixtures/server.crt --key ./integration/fixtures/server.key.insecure https://localhost:2379/v3/kv/put -X POST -d '{"key": "fromcurl", "value": "test"}'
CommonName of client sending a request against gateway will be ignored and not used as expected
```

The error will be returned if the server is enabling auth and gRPC
gateway.
2019-01-23 03:26:34 +09:00
Hitoshi Mitake 72dd4a18c5 *: add a new option --enable-grpc-gateway for enabling/disabling grpc gateway 2019-01-23 03:26:34 +09:00
Mark McLoughlin fcc29894c2 config: multiple logging fixes
First, don't panic with invalid --log-outputs. For example:

  $> ./bin/etcd --log-outputs foo
  2018-12-20 15:05:47.988652 C | embed: unknown log-output "foo" (only supports "default", "stderr", "stdout")
  panic: unknown log-output "foo" (only supports "default", "stderr", "stdout")

  goroutine 1 [running]:
  go.etcd.io/etcd/vendor/github.com/coreos/pkg/capnslog.(*PackageLogger).Panicf(0xc000294b00, 0x10fe067, 0x30, 0xc0001fa398, 0x4, 0x4)
        go.etcd.io/etcd/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go:75 +0x161
  go.etcd.io/etcd/embed.(*Config).setupLogging(0xc000291400, 0xc0002a85b0, 0x1)
        go.etcd.io/etcd/embed/config_logging.go:120 +0x1939
  ...

Or:

 $> ./bin/etcd --log-outputs foo,default --logger zap
 panic: multi logoutput for "default" is not supported yet

 goroutine 1 [running]:
 go.etcd.io/etcd/embed.(*Config).setupLogging(0xc000314500, 0xc0001b2f70, 0x1)
        go.etcd.io/etcd/embed/config_logging.go:129 +0x2437
 go.etcd.io/etcd/embed.(*Config).Validate(0xc000314500, 0xc000268a98, 0x127e440)
        go.etcd.io/etcd/embed/config.go:543 +0x43

Second, don't exit in embed.setupLogging(). Before:

  $> ./bin/etcd --log-outputs foo,bar
  --logger=capnslog supports only 1 value in '--log-outputs', got ["bar" "foo"]

and after:

  $> ./bin/etcd --log-outputs foo,bar
  2018-12-20 15:10:24.317982 E | etcdmain: error verifying flags, --logger=capnslog supports only 1 value in '--log-outputs', got ["bar" "foo"]. See 'etcd --help'.

Third, remove duplicated unique strings code. UniqueStringsFromFlag()
is already available to return a sorted slice of values, so just use
that.

Lastly, fix a tiny logging typo in config.
2019-01-17 15:09:26 -05:00
nolouch ac090fe326 embed: add zap logger builder
Signed-off-by: nolouch <nolouch@gmail.com>
2019-01-15 23:22:04 +08:00
caoming e7b5f2de26 embed: add test cases in TestAutoCompactionModeParse. 2019-01-02 17:08:15 +08:00
Gyuho Lee c58f5cfeda test: disable "unparam" for now
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-17 11:30:28 -08:00
caoming 6744c57de3 embed: set log-outputs 'default' to 'stderr' config when zap mode 2018-12-06 09:33:51 +08:00
Xiang Li 3faed211e5 *: add flags to setup backend related config 2018-11-26 15:50:26 -08:00
Shin'ya Ueoka aa4313a55a *: fix github links 2018-11-10 11:14:18 +09:00
Gyuho Lee d37f1521b7 *: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Gyuho Lee 3ac4d208ac embed: combine all info-print functions
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-09 12:32:47 -07:00
Gyuho Lee 3125c0c3e8 embed: support custom cipher suites
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-05 12:50:29 -07:00
Gyuho Lee 1ebaeed5c1 embed: fix typo
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-25 11:15:47 -07:00