You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/safesocket
Josh Bleecher Snyder 63cd581c3f safesocket: add ConnectionStrategy, provide control over fallbacks
fee2d9fad added support for cmd/tailscale to connect to IPNExtension.
It came in two parts: If no socket was provided, dial IPNExtension first,
and also, if dialing the socket failed, fall back to IPNExtension.

The second half of that support caused the integration tests to fail
when run on a machine that was also running IPNExtension.
The integration tests want to wait until the tailscaled instances
that they spun up are listening. They do that by dialing the new
instance. But when that dial failed, it was falling back to IPNExtension,
so it appeared (incorrectly) that tailscaled was running.
Hilarity predictably ensued.

If a user (or a test) explicitly provides a socket to dial,
it is a reasonable assumption that they have a specific tailscaled
in mind and don't want to fall back to IPNExtension.
It is certainly true of the integration tests.

Instead of adding a bool to Connect, split out the notion of a
connection strategy. For now, the implementation remains the same,
but with the details hidden a bit. Later, we can improve that.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
3 years ago
..
basic_test.go safesocket: add ConnectionStrategy, provide control over fallbacks 3 years ago
pipe_windows.go safesocket: add ConnectionStrategy, provide control over fallbacks 3 years ago
safesocket.go safesocket: add ConnectionStrategy, provide control over fallbacks 3 years ago
safesocket_darwin.go
safesocket_js.go safesocket: add ConnectionStrategy, provide control over fallbacks 3 years ago
safesocket_ps.go
safesocket_test.go
unixsocket.go safesocket: add ConnectionStrategy, provide control over fallbacks 3 years ago