feat(cli): support bundle: dump healthcheck summary (#12963)

* refactor(codersdk): extract common fields from HealthReport and friends
* feat(codersdk/healthsdk): add Summarize() method
* feat(cli): support bundle: dump healthcheck summary
This commit is contained in:
Cian Johnston
2024-04-16 13:31:56 +01:00
committed by GitHub
parent 06e042acfa
commit 407e61ecd4
13 changed files with 590 additions and 242 deletions

View File

@ -184,6 +184,15 @@ func (r *RootCmd) supportBundle() *serpent.Command {
_ = os.Remove(outputPath) // best effort
return xerrors.Errorf("create support bundle: %w", err)
}
deployHealthSummary := bun.Deployment.HealthReport.Summarize()
if len(deployHealthSummary) > 0 {
cliui.Warn(inv.Stdout, "Deployment health issues detected:", deployHealthSummary...)
}
clientNetcheckSummary := bun.Network.Netcheck.Summarize("Client netcheck:")
if len(clientNetcheckSummary) > 0 {
cliui.Warn(inv.Stdout, "Networking issues detected:", deployHealthSummary...)
}
bun.CLILogs = cliLogBuf.Bytes()
if err := writeBundle(bun, zwr); err != nil {