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/tstest
Alex Chan 41a2aaf1da cmd/tailscale/cli: fix race condition in `up --force-reauth`
This commit fixes a race condition where `tailscale up --force-reauth` would
exit prematurely on an already-logged in device.

Previously, the CLI would wait for IPN to report the "Running" state and then
exit. However, this could happen before the new auth URL was printed, leading
to two distinct issues:

*   **Without seamless key renewal:** The CLI could exit immediately after
    the `StartLoginInteractive` call, before IPN has time to switch into
    the "Starting" state or send a new auth URL back to the CLI.
*   **With seamless key renewal:** IPN stays in the "Running" state
    throughout the process, so the CLI exits immediately without performing
    any reauthentication.

The fix is to change the CLI's exit condition.

Instead of waiting for the "Running" state, if we're doing a `--force-reauth`
we now wait to see the node key change, which is a more reliable indicator
that a successful authentication has occurred.

Updates tailscale/corp#31476
Updates tailscale/tailscale#17108

Signed-off-by: Alex Chan <alexc@tailscale.com>
4 months ago
..
archtest all: cleanup unused code, part 1 (#10661) 2 years ago
deptest ipn/ipnlocal: use policyclient.Client always, stop using global syspolicy funcs 5 months ago
integration cmd/tailscale/cli: fix race condition in `up --force-reauth` 4 months ago
iosdeps feature/capture: move packet capture to feature/*, out of iOS + CLI 1 year ago
jsdeps all: use math/rand/v2 more 2 years ago
mts tstest/mts: add multiple-tailscaled development tool 10 months ago
natlab derp/derpserver: clean up extraction of derp.Server (#17264) 4 months ago
nettest net/{netx,memnet},all: add netx.DialFunc, move memnet Network impl 10 months ago
tailmac tstest/tailmac: add support for mounting host directories in the guest (#13957) 1 year ago
tlstest tstest/tlstest: simplify, don't even bake in any keys 7 months ago
tools go.{mod,sum},tstest/tools,k8s-operator,cmd/k8s-operator: autogenerate CRD API docs (#12884) 2 years ago
allocs.go all: update copyright and license headers 3 years ago
clock.go tstime: add Since method (#8622) 3 years ago
clock_test.go all: use Go 1.22 range-over-int 2 years ago
log.go net/portmapper: fix test flakes from logging after test done 9 months ago
log_test.go all: update copyright and license headers 3 years ago
reflect.go net/dns: fix IsZero and Equal methods on OSConfig 1 year ago
resource.go tstest: parse goroutines for diff in ResourceCheck (#15619) 10 months ago
resource_test.go tstest: parse goroutines for diff in ResourceCheck (#15619) 10 months ago
test-wishlist.md wf/firewall: allow link-local multicast for permitted local routes when the killswitch is on on Windows 1 year ago
tstest.go ipn/{conffile,ipnlocal}: start booting tailscaled from a config file w/ auth key 2 years ago
tstest_test.go tstest: add method to Replace values for tests 3 years ago