Skip to content

Commit

Permalink
Merge pull request #13261 from smarterclayton/wait_for_capable
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Mar 7, 2017
2 parents da719a3 + 9390478 commit 1a2cfff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/server/etcd/etcdserver/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/pkg/osutil"
"github.com/coreos/etcd/pkg/types"
"github.com/coreos/go-semver/semver"
"github.com/golang/glog"

configapi "github.com/openshift/origin/pkg/cmd/server/api"
Expand Down Expand Up @@ -74,6 +75,11 @@ func RunEtcd(etcdServerConfig *configapi.EtcdConfig) {

select {
case <-e.Server.ReadyNotify():
// embedded servers must negotiate to reach v3 mode, this ensures we loop until that happens
glog.V(4).Infof("Waiting for etcd to reach cluster version 3.0.0")
for min := semver.Must(semver.NewVersion("3.0.0")); e.Server.ClusterVersion() == nil || e.Server.ClusterVersion().LessThan(*min); {
time.Sleep(25 * time.Millisecond)
}
glog.Infof("Started etcd at %s", etcdServerConfig.Address)
case <-time.After(60 * time.Second):
glog.Warning("etcd took too long to start, stopped")
Expand Down

0 comments on commit 1a2cfff

Please sign in to comment.