Run 'etcd2' if it exists, in preference to 'etcd'

This is to accommodate CoreOS, where 'etcd' is a very old version
This commit is contained in:
Bryan Boreham 2016-08-04 14:36:25 +01:00 committed by Bryan Boreham
parent dbc59aad7c
commit 1307799a66

View File

@ -181,7 +181,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)