mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-23 03:17:43 +00:00
control/controlclient,health,tailcfg: refactor control health messages (#15839)
* control/controlclient,health,tailcfg: refactor control health messages Updates tailscale/corp#27759 Signed-off-by: James Sanderson <jsanderson@tailscale.com> Signed-off-by: Paul Scott <408401+icio@users.noreply.github.com> Co-authored-by: Paul Scott <408401+icio@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
980ab4244d
commit
aa8bc23c49
@@ -933,11 +933,15 @@ func (b *LocalBackend) linkChange(delta *netmon.ChangeDelta) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *LocalBackend) onHealthChange(w *health.Warnable, us *health.UnhealthyState) {
|
||||
if us == nil {
|
||||
b.logf("health(warnable=%s): ok", w.Code)
|
||||
} else {
|
||||
b.logf("health(warnable=%s): error: %s", w.Code, us.Text)
|
||||
func (b *LocalBackend) onHealthChange(change health.Change) {
|
||||
if change.WarnableChanged {
|
||||
w := change.Warnable
|
||||
us := change.UnhealthyState
|
||||
if us == nil {
|
||||
b.logf("health(warnable=%s): ok", w.Code)
|
||||
} else {
|
||||
b.logf("health(warnable=%s): error: %s", w.Code, us.Text)
|
||||
}
|
||||
}
|
||||
|
||||
// Whenever health changes, send the current health state to the frontend.
|
||||
@@ -5826,7 +5830,7 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
|
||||
b.pauseOrResumeControlClientLocked()
|
||||
|
||||
if nm != nil {
|
||||
b.health.SetControlHealth(nm.ControlHealth)
|
||||
b.health.SetControlHealth(nm.DisplayMessages)
|
||||
} else {
|
||||
b.health.SetControlHealth(nil)
|
||||
}
|
||||
|
Reference in New Issue
Block a user