Merge pull request #29267 from bboreham/e2e-etcd-port

Automatic merge from submit-queue

For e2e_node tests tell etcd to listen on ports 2379 and 4001

This is the default for etcd2, but etcd3 only listens on 2379.
Specifying the ports keeps things consistent no matter which version the user has installed.

Fixes #29117
This commit is contained in:
Kubernetes Submit Queue 2016-08-05 18:44:33 -07:00 committed by GitHub
commit 59c916c1d7

View File

@ -182,7 +182,12 @@ func (es *e2eService) startEtcd() (*killCmd, error) {
return nil, err
}
es.etcdDataDir = dataDir
etcdPath, err := exec.LookPath("etcd")
var etcdPath string
// CoreOS ships a binary named 'etcd' which is really old, so prefer 'etcd2' if it exists
etcdPath, err = exec.LookPath("etcd2")
if err != nil {
etcdPath, err = exec.LookPath("etcd")
}
if err != nil {
glog.Infof("etcd not found in PATH. Defaulting to %s...", defaultEtcdPath)
_, err = os.Stat(defaultEtcdPath)
@ -191,7 +196,9 @@ func (es *e2eService) startEtcd() (*killCmd, error) {
}
etcdPath = defaultEtcdPath
}
cmd := exec.Command(etcdPath)
cmd := exec.Command(etcdPath,
"--listen-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001",
"--advertise-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001")
// Execute etcd in the data directory instead of using --data-dir because the flag sometimes requires additional
// configuration (e.g. --name in version 0.4.9)
cmd.Dir = es.etcdDataDir