cmd/tailscale: surface authentication errors in status.Health (#4748)

Fixes #3713

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2022-06-03 10:52:07 -07:00
committed by GitHub
parent c980bf01be
commit 43f9c25fd2
5 changed files with 41 additions and 10 deletions

View File

@ -128,12 +128,8 @@ func runStatus(ctx context.Context, args []string) error {
return err
}
description, ok := isRunningOrStarting(st)
if !ok {
outln(description)
os.Exit(1)
}
// print health check information prior to checking LocalBackend state as
// it may provide an explanation to the user if we choose to exit early
if len(st.Health) > 0 {
printf("# Health check:\n")
for _, m := range st.Health {
@ -142,6 +138,12 @@ func runStatus(ctx context.Context, args []string) error {
outln()
}
description, ok := isRunningOrStarting(st)
if !ok {
outln(description)
os.Exit(1)
}
var buf bytes.Buffer
f := func(format string, a ...any) { fmt.Fprintf(&buf, format, a...) }
printPS := func(ps *ipnstate.PeerStatus) {