mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-25 19:21:18 -08:00
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:
1 parent
7e5619aee8
commit
15652c4e27
1 file changed
+10
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user