health, controlclient, ipn, magicsock: tell health package state of things

Not yet checking anything. Just plumbing states into the health package.

Updates #1505

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-02-24 21:29:51 -08:00
parent 770aa71ffb
commit ba8c6d0775
5 changed files with 126 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ import (
"golang.org/x/oauth2"
"inet.af/netaddr"
"tailscale.com/control/controlclient"
"tailscale.com/health"
"tailscale.com/internal/deepprint"
"tailscale.com/ipn"
"tailscale.com/ipn/ipnstate"
@@ -1514,6 +1515,7 @@ func (b *LocalBackend) enterState(newState ipn.State) {
}
b.logf("Switching ipn state %v -> %v (WantRunning=%v)",
state, newState, prefs.WantRunning)
health.SetIPNState(newState.String(), prefs.WantRunning)
if notify != nil {
b.send(ipn.Notify{State: &newState})
}