Skip to content

Commit 407e61e

Browse files
authored
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
1 parent 06e042a commit 407e61e

File tree

13 files changed

+588
-240
lines changed

13 files changed

+588
-240
lines changed

cli/support.go

+9
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ func (r *RootCmd) supportBundle() *serpent.Command {
184184
_ = os.Remove(outputPath) // best effort
185185
return xerrors.Errorf("create support bundle: %w", err)
186186
}
187+
deployHealthSummary := bun.Deployment.HealthReport.Summarize()
188+
if len(deployHealthSummary) > 0 {
189+
cliui.Warn(inv.Stdout, "Deployment health issues detected:", deployHealthSummary...)
190+
}
191+
clientNetcheckSummary := bun.Network.Netcheck.Summarize("Client netcheck:")
192+
if len(clientNetcheckSummary) > 0 {
193+
cliui.Warn(inv.Stdout, "Networking issues detected:", deployHealthSummary...)
194+
}
195+
187196
bun.CLILogs = cliLogBuf.Bytes()
188197

189198
if err := writeBundle(bun, zwr); err != nil {

coderd/apidoc/docs.go

+22-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+14-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/healthcheck/derphealth/derp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ func (r *RegionReport) Run(ctx context.Context) {
156156
node = node
157157
nodeReport = NodeReport{
158158
DERPNodeReport: healthsdk.DERPNodeReport{
159-
Node: node,
160159
Healthy: true,
160+
Node: node,
161161
},
162162
}
163163
)

0 commit comments

Comments
 (0)