mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add interfaces report to support bundle (#13563)
This commit is contained in:
+13
-3
@@ -47,9 +47,10 @@ type Deployment struct {
|
||||
|
||||
type Network struct {
|
||||
ConnectionInfo workspacesdk.AgentConnectionInfo
|
||||
CoordinatorDebug string `json:"coordinator_debug"`
|
||||
Netcheck *derphealth.Report `json:"netcheck"`
|
||||
TailnetDebug string `json:"tailnet_debug"`
|
||||
CoordinatorDebug string `json:"coordinator_debug"`
|
||||
Netcheck *derphealth.Report `json:"netcheck"`
|
||||
TailnetDebug string `json:"tailnet_debug"`
|
||||
Interfaces healthsdk.InterfacesReport `json:"interfaces"`
|
||||
}
|
||||
|
||||
type Netcheck struct {
|
||||
@@ -194,6 +195,15 @@ func NetworkInfo(ctx context.Context, client *codersdk.Client, log slog.Logger)
|
||||
return nil
|
||||
})
|
||||
|
||||
eg.Go(func() error {
|
||||
rpt, err := healthsdk.RunInterfacesReport()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("run interfaces report: %w", err)
|
||||
}
|
||||
n.Interfaces = rpt
|
||||
return nil
|
||||
})
|
||||
|
||||
if err := eg.Wait(); err != nil {
|
||||
log.Error(ctx, "fetch network information", slog.Error(err))
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ func TestRun(t *testing.T) {
|
||||
assertNotNilNotEmpty(t, bun.Network.CoordinatorDebug, "network coordinator debug should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.Netcheck, "network netcheck should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.TailnetDebug, "network tailnet debug should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.Interfaces, "network interfaces health should be present")
|
||||
assertNotNilNotEmpty(t, bun.Workspace.Workspace, "workspace should be present")
|
||||
assertSanitizedWorkspace(t, bun.Workspace.Workspace)
|
||||
assertNotNilNotEmpty(t, bun.Workspace.BuildLogs, "workspace build logs should be present")
|
||||
@@ -114,6 +115,7 @@ func TestRun(t *testing.T) {
|
||||
assertNotNilNotEmpty(t, bun.Network.CoordinatorDebug, "network coordinator debug should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.Netcheck, "network netcheck should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.TailnetDebug, "network tailnet debug should be present")
|
||||
assertNotNilNotEmpty(t, bun.Network.Interfaces, "network interfaces health should be present")
|
||||
assert.Empty(t, bun.Workspace.Workspace, "did not expect workspace to be present")
|
||||
assert.Empty(t, bun.Agent, "did not expect agent to be present")
|
||||
assertNotNilNotEmpty(t, bun.Logs, "bundle logs should be present")
|
||||
|
||||
Reference in New Issue
Block a user