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>
2021-12-09 15:46:38 -08:00
..
basic_test.go safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00
pipe_windows.go safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00
safesocket.go safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00
safesocket_darwin.go safesocket: actually fix CLI on macsys build 2021-09-24 13:58:26 -07:00
safesocket_js.go safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00
safesocket_ps.go all: minor code cleanup 2021-12-09 15:46:38 -08:00
safesocket_test.go safesocket: refactor macOS auth code, pull out separate LocalTCPPortAndToken 2021-01-29 14:34:57 -08:00
unixsocket.go safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00