In prep for making health warnings rich objects with metadata rather
than a bunch of strings, start moving it all into the same place.
We'll still ultimately need the stringified form for the CLI and
LocalAPI for compatibility but we'll next convert all these warnings
into Warnables that have severity levels and such, and legacy
stringification will just be something each Warnable thing can do.
Updates #4136
Change-Id: I83e189435daae3664135ed53c98627c66e9e53da
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
add(fmt.Errorf("Security update available: %v -> %v, run `tailscale update` or `tailscale set --auto-update` to update",version.Short(),cv.LatestVersion))
}else{
add(fmt.Errorf("Update available: %v -> %v, run `tailscale update` or `tailscale set --auto-update` to update",version.Short(),cv.LatestVersion))
s.Health=append(s.Health,fmt.Sprintf("Security update available: %v -> %v, run `tailscale update` or `tailscale set --auto-update` to update",version.Short(),cv.LatestVersion))
}else{
s.Health=append(s.Health,fmt.Sprintf("Update available: %v -> %v, run `tailscale update` or `tailscale set --auto-update` to update",version.Short(),cv.LatestVersion))
}
}
}
iferr:=b.health.OverallError();err!=nil{
switche:=err.(type){
casemultierr.Error:
for_,err:=rangee.Errors(){
s.Health=append(s.Health,err.Error())
}
default:
s.Health=append(s.Health,err.Error())
}
}
s.Health=b.health.AppendWarnings(s.Health)
// TODO(bradfitz): move this health check into a health.Warnable