|
|
|
@ -308,7 +308,7 @@ func (e *ETCD) IsInitialized() (bool, error) {
|
|
|
|
|
func (e *ETCD) Reset(ctx context.Context, rebootstrap func() error) error {
|
|
|
|
|
// Wait for etcd to come up as a new single-node cluster, then exit
|
|
|
|
|
go func() {
|
|
|
|
|
<-e.config.Runtime.AgentReady
|
|
|
|
|
<-e.config.Runtime.ContainerRuntimeReady
|
|
|
|
|
t := time.NewTicker(5 * time.Second)
|
|
|
|
|
defer t.Stop()
|
|
|
|
|
for range t.C {
|
|
|
|
@ -450,8 +450,8 @@ func (e *ETCD) Start(ctx context.Context, clientAccessInfo *clientaccess.Info) e
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
|
case <-time.After(30 * time.Second):
|
|
|
|
|
logrus.Infof("Waiting for agent to become ready before joining etcd cluster")
|
|
|
|
|
case <-e.config.Runtime.AgentReady:
|
|
|
|
|
logrus.Infof("Waiting for container runtime to become ready before joining etcd cluster")
|
|
|
|
|
case <-e.config.Runtime.ContainerRuntimeReady:
|
|
|
|
|
if err := wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
|
|
|
|
|
if err := e.join(ctx, clientAccessInfo); err != nil {
|
|
|
|
|
// Retry the join if waiting for another member to be promoted, or waiting for peers to connect after promotion
|
|
|
|
@ -1040,7 +1040,7 @@ func (e *ETCD) RemovePeer(ctx context.Context, name, address string, allowSelfRe
|
|
|
|
|
// being promoted to full voting member. The checks only run on the cluster member that is
|
|
|
|
|
// the etcd leader.
|
|
|
|
|
func (e *ETCD) manageLearners(ctx context.Context) {
|
|
|
|
|
<-e.config.Runtime.AgentReady
|
|
|
|
|
<-e.config.Runtime.ContainerRuntimeReady
|
|
|
|
|
t := time.NewTicker(manageTickerTime)
|
|
|
|
|
defer t.Stop()
|
|
|
|
|
|
|
|
|
|