mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 13:03:43 +00:00
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:
commit
59c916c1d7
@ -182,7 +182,12 @@ func (es *e2eService) startEtcd() (*killCmd, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
es.etcdDataDir = dataDir
|
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 {
|
if err != nil {
|
||||||
glog.Infof("etcd not found in PATH. Defaulting to %s...", defaultEtcdPath)
|
glog.Infof("etcd not found in PATH. Defaulting to %s...", defaultEtcdPath)
|
||||||
_, err = os.Stat(defaultEtcdPath)
|
_, err = os.Stat(defaultEtcdPath)
|
||||||
@ -191,7 +196,9 @@ func (es *e2eService) startEtcd() (*killCmd, error) {
|
|||||||
}
|
}
|
||||||
etcdPath = defaultEtcdPath
|
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
|
// 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)
|
// configuration (e.g. --name in version 0.4.9)
|
||||||
cmd.Dir = es.etcdDataDir
|
cmd.Dir = es.etcdDataDir
|
||||||
|
Loading…
Reference in New Issue
Block a user