Skip to content

Commit ef28150

Browse files
authored
Merge pull request #62 from aifoundry-org/bug-forever-wait
Timeout waiting for control node to join tailnet
2 parents e4d7a6c + 11e12d0 commit ef28150

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/cluster/cluster.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ func (c *Cluster) ensureClusterExists(ctx context.Context) (newKubeconfig []byte
203203
// wait for the control plane node to be up and running
204204
timeLeft := c.initWait
205205
for {
206+
if timeLeft <= 0 {
207+
c.logger.Errorf("Control plane at %s did not respond in time, exiting", clusterAccessIP)
208+
return nil, fmt.Errorf("control plane at %s did not respond in time", clusterAccessIP)
209+
}
210+
206211
c.logger.Infof("Waiting %s for control plane node to be up and running...", timeLeft)
207212
sleepTime := 30 * time.Second
208213
time.Sleep(sleepTime)
@@ -247,10 +252,6 @@ func (c *Cluster) ensureClusterExists(ctx context.Context) (newKubeconfig []byte
247252
c.logger.Infof("Control plane at %s is up and running", clusterAccessIP)
248253
break
249254
}
250-
if timeLeft <= 0 {
251-
c.logger.Errorf("Control plane at %s did not respond in time, exiting", clusterAccessIP)
252-
return nil, fmt.Errorf("control plane at %s did not respond in time", clusterAccessIP)
253-
}
254255
}
255256
// attach the floating IP to the control plane node, if not done already
256257
if !fipAttached {

0 commit comments

Comments
 (0)