mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 17:03:06 +00:00
f176503448
When using running `tailscale up` in the AuthKey flow process, the tailscale client immediately enters PollMap after registration - avoiding a race condition. When using the web auth (up -> go to the Control website -> CLI `register`) the client is polling checking if it has been authorized. If we immediately ask for the client IP, as done in CreateHeadscaleEnv() we might have the client in NotReady status. This method provides a way to wait for the client to be ready. Signed-off-by: Juan Font Alonso <juanfontalonso@gmail.com>
23 lines
500 B
Go
23 lines
500 B
Go
package integration
|
|
|
|
import (
|
|
"net/netip"
|
|
"net/url"
|
|
|
|
"tailscale.com/ipn/ipnstate"
|
|
)
|
|
|
|
type TailscaleClient interface {
|
|
Hostname() string
|
|
Shutdown() error
|
|
Version() string
|
|
Execute(command []string) (string, string, error)
|
|
Up(loginServer, authKey string) error
|
|
UpWithLoginURL(loginServer string) (*url.URL, error)
|
|
IPs() ([]netip.Addr, error)
|
|
FQDN() (string, error)
|
|
Status() (*ipnstate.Status, error)
|
|
WaitForReady() error
|
|
WaitForPeers(expected int) error
|
|
Ping(hostnameOrIP string) error
|
|
}
|