Heartbeat timeout means the period length that indicates heartbeat is
out of service, which is different from heartbeat interval.
So we should use '-peer-heartbeat-interval' instead of
'-peer-heartbeat-timeout' in etcd.
'-peer-heartbeat-timeout' is deprecated but still could be used.
Before this change if the value of a Node was "" it would get dropped from the json
encoding and the Node.Value field would be missing. Fix this problem by making
NodeExtern.Value a *string so that an empty string will be encoded but a nil value
will drop the field.
The boot order for peers is -discovery, -peers, log data, forming
new cluster itself.
Special rules:
1. If discovery succeeds, it would find peers specified by discover URL
only.
2. Etcd would fail when meeting bad -discovery, no -peers and log data.
Add TestDiscoveryDownNoBackupPeersWithDataDir as the test.
Lets get a bit more consistent in printing the versions:
```
$ ./bin/etcd -version
etcd version 0.3.0+git
$ ./bin/etcdctl -v
etcdctl version 0.3.0+git
```
This should cover most aspects of the v1 API but being new to the etcd
code base I cannot promise that or that the tests are even correct.
They do pass though :)
This is an initial version of the bootstrap code that seems to work
under the normal circumstances. I need to mock out a server that will
test out all of the error cases now.
Refactor config into its own package. Trying to tease the config from
the server so that all of the control surfaces are exposed in the Server
for easier testing.
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven -copy -rewrite $i; done
In d0c4916fe9b2afaa273a2a7bc9782321a866ab9f the TLS CA Certificate
verification broke.
This was bisected using the following basic test:
```
./bin/etcd -f -name machine0 -data-dir machine0 -ca-file=/tmp/ca/ca.crt -cert-file=/tmp/ca/server.crt -key-file=/tmp/ca/server.key.insecure
```
And in another window doing
```
curl --key /tmp/ca/server2.key.insecure --cert /tmp/ca/server2.crt -k -L https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```
Before merging this PR there are a few things that need to be fixed up:
1) Tests for client certs both positive and negative
2) Refactor (or at least documentation of) the TLSConfig types
* server/cors.go renamed to http/cors.go
* all CORS code removed from Server and PeerServer
* Server and PeerServer fulfill http.Handler, now passed to http.Serve
* non-HTTP code in PeerServer.Serve moved to PeerServer.Start