Commit Graph

155 Commits (37fe4b9afac63b8269184168bd01787cad866844)

Author SHA1 Message Date
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
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
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07: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
Gyu-Ho Lee ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
Gyu-Ho Lee dae7e009b0 *: godoc clean up 2016-03-19 14:19:23 -07:00
Yicheng Qin 02be882c8f migrate: remove starter code
It has been moved to github.com/coreos/etcd-starter.
2015-03-20 10:51:42 -07:00
Xiang Li fce80136e3 main: detects coreos 2015-01-30 12:10:05 -08:00
Yicheng Qin ec5a6e8beb migrate: support start desired version 2015-01-30 00:35:53 -08:00
Jonathan Boulle f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Jonathan Boulle cf9dd31daa etcd: move main logic to etcdmain subpackage 2014-10-29 18:43:22 -07:00
Jonathan Boulle a96f5ab146 main: catch a few unhandled errors
If any of this initialization fails, something very bad has happened,
and we should not continue as-is (this has previously manifested in
strange bugs)
2014-10-28 11:18:22 -07:00
Kelsey Hightower b1731f0843 etcd: ensure data dir is writable
etcd checks that the data dir is writable by writing and removing an
empty file to the data dir during startup and exits non-zero if that
fails.

fixes #876
2014-10-27 16:52:05 -07:00
Jonathan Boulle 6e6d1897d8 pkg: move everything into subpackages 2014-10-27 09:57:28 -07:00
Xiang Li 009b737cef *: better logging 2014-10-26 08:13:03 -07:00
Brian Waldon 677d9d1bea etcd: use old default data-dir format 2014-10-24 16:41:42 -07:00
Jonathan Boulle 719c57a29d proxy: retrieve ClientURLs from cluster
This is a simple solution to having the proxy keep up to date with the
state of the cluster. Basically, it uses the cluster configuration
provided at start up (i.e. with `-initial-cluster-state`) to determine
where to reach peer(s) in the cluster, and then it will periodically hit
the `/members` endpoint of those peer(s) (using the same mechanism that
`-cluster-state=existing` does to initialise) to update the set of valid
client URLs to proxy to.

This does not address discovery (#1376), and it would probably be better
to update the set of proxyURLs dynamically whenever we fetch the new
state of the cluster; but it needs a bit more thinking to have this done
in a clean way with the proxy interface.

Example in Procfile works again.
2014-10-24 15:54:12 -07:00
Xiang Li 2e84eb3c36 *: change advertise-peer-urls -> initial-advertise-peer-urls 2014-10-24 13:51:59 -07:00
Brian Waldon c8634428fa Merge pull request #1364 from bcwaldon/import-etcdctl
Import etcdctl
2014-10-24 12:02:41 -07:00
Jonathan Boulle d7301a5cf4 main: fix proxy initialization and setupCluster 2014-10-23 16:09:29 -07:00
Yicheng Qin 5fbe6c7134 main: add genClusterString func and its test 2014-10-23 14:19:40 -07:00
Yicheng Qin e21de51768 etcdserver: remove NewClusterFromMemberInfos 2014-10-23 13:27:55 -07:00
Yicheng Qin 89572b5fd7 etcdserver: refactor cluster and clusterStore
Integrate clusterStore into cluster, and let cluster become the source of
cluster info.
2014-10-23 13:27:54 -07:00
Brian Waldon 46be5d7d5f version: move version string into new package 2014-10-22 17:52:40 -07:00
Barak Michener 1f84991b3a Merge pull request #1355 from barakmich/cluster_after_wal
etcdserver: Check the initial cluster settings after checking if the WAL...
2014-10-22 18:31:28 -04:00
Barak Michener e42d65da12 etcdserver: Check the initial cluster settings after checking if the WAL exists 2014-10-22 18:16:43 -04:00
Xiang Li 5444a366da main: use our own flagset in setupCluster 2014-10-22 14:51:51 -07:00
Xiang Li ca4f12182a main: fix default case 2014-10-22 13:49:52 -07:00
Barak Michener cb5a638c44 style comments 2014-10-22 13:52:42 -04:00
Barak Michener 52dedab7b4 Move setupCluster inside startEtcd 2014-10-22 13:52:42 -04:00
Barak Michener 502a3c2460 Refactor Cluster to hold and add members. 2014-10-22 13:52:42 -04:00
Barak Michener ad0b7b7dbb Add cluster name to etcd flags 2014-10-22 13:52:42 -04:00
Barak Michener 1ca7c031ff first round of comments
Conflicts:
	etcdserver/config.go
	etcdserver/config_test.go
	etcdserver/server.go
	main.go
2014-10-22 13:49:54 -04:00
Barak Michener 456d1ebcae etcdserver: Calculate IDs for nodes solely on PeerURLs
Removes the notion of name being anything more than advisory or
command-line grouping, and adds checks for bootstrapping the command
line. IDs are consistent if the URLs are consistent.
2014-10-22 13:49:54 -04:00
Jonathan Boulle 341c7190d3 test: add govet to tests 2014-10-21 11:32:38 -07:00
Jonathan Boulle 63b328ed11 main: exit 0 on -h/--help 2014-10-20 15:32:58 -07:00
Yicheng Qin dcaa7f0a37 Merge pull request #1328 from unihorn/169
skip initial-cluster check when reboot
2014-10-20 13:06:24 -07:00
Jonathan Boulle 7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
Yicheng Qin aa176610f3 main: remove duplicated self name check 2014-10-17 15:37:30 -07:00
Jonathan Boulle bc7d372d5c main: correct peer-addr reference 2014-10-16 20:06:26 -07:00
Xiang Li efba919a93 main: use node name as default dir
We use nodeID as the default dir previously. It works fine before we do dynamic nodeID
generation (introducing time). After the change the dynamic nodeID will change every
time we restart the etcd process. If the user does not provide the data dir, the default
dir will change every time. It is not the desired behavior.

In this commit, we change the default data dir to node name. If the user changes the node
name and does provide the data dir, etcd still cannot recover from previous state. But it
is much better than using nodeID. And it is actually a doucmentation issue.

Conflicts:
	main.go
2014-10-16 21:22:12 +08:00
Xiang Li 828accf07b etcdserver: better logging 2014-10-15 13:07:34 +08:00
Jonathan Boulle a6dfde85e4 main: fix typos and initial-cluster references 2014-10-13 14:52:49 -07:00
Xiang Li 8bbbaa88b2 *: raft related int64 -> uint64 2014-10-09 14:29:21 +08:00
Brandon Philips 6cbc282be1 main: use a new cluster by default
This is a safe default for now. Use it to make `./etcd` work again.
2014-10-06 17:34:14 -07:00
Jonathan Boulle 5098cb0d32 main: fix temporary discovery cluster 2014-10-06 16:10:29 -07:00
Brandon Philips 3500b56e54 Merge pull request #1237 from philips/0.5-docs
use initial-cluster and initial-cluster-state flags
2014-10-06 15:04:04 -07:00
Brandon Philips e2d8037ded main: use initial-cluster and initial-cluster-state flags
In preperation for adding the ability to join a machine to an existing
cluster force the user to specify whether they expect this to me a new
cluster or an active one.

The error for not specifying the initial-cluster-state is:
```
etcd: initial cluster state unset and no wal found
```
2014-10-06 14:59:25 -07:00
Jonathan Boulle ec7bcbb50d main: fail on peers/peers-file flags 2014-10-06 14:25:11 -07:00