Make sure all clients of a user are ready (#1335)
This commit is contained in:
parent
d0b3b1bfc4
commit
9836b097a4
|
@ -362,6 +362,15 @@ func (s *AuthOIDCScenario) runTailscaleUp(
|
||||||
|
|
||||||
user.joinWaitGroup.Wait()
|
user.joinWaitGroup.Wait()
|
||||||
|
|
||||||
|
for _, client := range user.Clients {
|
||||||
|
err := client.WaitForReady()
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("client %s was not ready: %s", client.Hostname(), err)
|
||||||
|
|
||||||
|
return fmt.Errorf("failed to up tailscale node: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,6 +274,15 @@ func (s *AuthWebFlowScenario) runTailscaleUp(
|
||||||
}
|
}
|
||||||
user.joinWaitGroup.Wait()
|
user.joinWaitGroup.Wait()
|
||||||
|
|
||||||
|
for _, client := range user.Clients {
|
||||||
|
err := client.WaitForReady()
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("client %s was not ready: %s", client.Hostname(), err)
|
||||||
|
|
||||||
|
return fmt.Errorf("failed to up tailscale node: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -356,6 +356,15 @@ func (s *Scenario) RunTailscaleUp(
|
||||||
|
|
||||||
user.joinWaitGroup.Wait()
|
user.joinWaitGroup.Wait()
|
||||||
|
|
||||||
|
for _, client := range user.Clients {
|
||||||
|
err := client.WaitForReady()
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("client %s was not ready: %s", client.Hostname(), err)
|
||||||
|
|
||||||
|
return fmt.Errorf("failed to up tailscale node: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -430,6 +430,15 @@ func (t *TailscaleInContainer) WaitForReady() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ipnstate.Status.CurrentTailnet was added in Tailscale 1.22.0
|
||||||
|
// https://github.com/tailscale/tailscale/pull/3865
|
||||||
|
//
|
||||||
|
// Before that, we can check the BackendState to see if the
|
||||||
|
// tailscaled daemon is connected to the control system.
|
||||||
|
if status.BackendState == "Running" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return errTailscaleNotConnected
|
return errTailscaleNotConnected
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue