cmd/tailscale/cli: kick off login after Start in tailscale join

LocalClient.Start applies prefs and stashes the auth key but does
not actually drive a login: when the daemon has no node key it
transitions NoState -> NeedsLogin and waits. tailscale up handles
this by calling StartLoginInteractive immediately after Start when
HaveNodeKey is false (see cmd/tailscale/cli/up.go:683-688). join
omitted that call, so the join command would print "Bound to
blueprint bp:<id>" while the daemon silently sat in NeedsLogin
without ever registering the node against the control plane.

Always kick the login from join. The earlier status check refuses
to run if BackendState is Running, so by the time we reach Start
we know we are doing a fresh registration; there is no
HaveNodeKey case worth preserving.

Updates #cleanup

Signed-off-by: Kabir Sikand <[email protected]>
This commit is contained in:
Kabir Sikand committed 2026-05-18 17:48:42 +00:00
1 parent 7e5619aee8
commit 15652c4e27
1 file changed
+10
+10
View File
@@ -184,6 +184,16 @@ func runJoin(ctx context.Context, args []string, ja *joinArgsT) (retErr error) {
}); err != nil {
return fmt.Errorf("starting tailscale: %w", err)
}
// Start alone applies prefs and stores the auth key; the daemon
// then waits in NeedsLogin until something asks it to log in.
// tailscale up handles this by calling StartLoginInteractive when
// the daemon has no node key (see cmd/tailscale/cli/up.go). join
// is by definition a fresh registration -- the earlier status
// check refuses to run if BackendState is already Running -- so
// we always trigger the login here.
if err := localClient.StartLoginInteractive(ctx); err != nil {
return fmt.Errorf("kicking off blueprint join login: %w", err)
}
metricBlueprintJoinSuccess.Add(1)
metricBlueprintBound.Set(1)