mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
cmd/tailscale: be quiet when no interaction or errors are needed.
We would print a message about "nothing more to do", which some people thought was an error or warning. Let's only print a message after authenticating if we previously asked for interaction, and let's shorten that message to just "Success," which is what it means. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
parent
30e5c19214
commit
99aa33469e
@ -224,6 +224,8 @@ func runUp(ctx context.Context, args []string) error {
|
|||||||
c, bc, ctx, cancel := connect(ctx)
|
c, bc, ctx, cancel := connect(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
var printed bool
|
||||||
|
|
||||||
bc.SetPrefs(prefs)
|
bc.SetPrefs(prefs)
|
||||||
opts := ipn.Options{
|
opts := ipn.Options{
|
||||||
StateKey: globalStateKey,
|
StateKey: globalStateKey,
|
||||||
@ -235,12 +237,17 @@ func runUp(ctx context.Context, args []string) error {
|
|||||||
if s := n.State; s != nil {
|
if s := n.State; s != nil {
|
||||||
switch *s {
|
switch *s {
|
||||||
case ipn.NeedsLogin:
|
case ipn.NeedsLogin:
|
||||||
|
printed = true
|
||||||
bc.StartLoginInteractive()
|
bc.StartLoginInteractive()
|
||||||
case ipn.NeedsMachineAuth:
|
case ipn.NeedsMachineAuth:
|
||||||
|
printed = true
|
||||||
fmt.Fprintf(os.Stderr, "\nTo authorize your machine, visit (as admin):\n\n\t%s/admin/machines\n\n", upArgs.server)
|
fmt.Fprintf(os.Stderr, "\nTo authorize your machine, visit (as admin):\n\n\t%s/admin/machines\n\n", upArgs.server)
|
||||||
case ipn.Starting, ipn.Running:
|
case ipn.Starting, ipn.Running:
|
||||||
// Done full authentication process
|
// Done full authentication process
|
||||||
fmt.Fprintf(os.Stderr, "tailscaled is authenticated, nothing more to do.\n")
|
if printed {
|
||||||
|
// Only need to print an update if we printed the "please click" message earlier.
|
||||||
|
fmt.Fprintf(os.Stderr, "Success.\n")
|
||||||
|
}
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user