Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc7fdce

Browse files
committed
feat: add interfaces report to support bundle
1 parentdcebda4 commitbc7fdce

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

‎cli/support.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ func writeBundle(src *support.Bundle, dest *zip.Writer) error {
254254
"deployment/health.json":src.Deployment.HealthReport,
255255
"network/connection_info.json":src.Network.ConnectionInfo,
256256
"network/netcheck.json":src.Network.Netcheck,
257+
"network/interfaces.json":src.Network.Interfaces,
257258
"workspace/template.json":src.Workspace.Template,
258259
"workspace/template_version.json":src.Workspace.TemplateVersion,
259260
"workspace/parameters.json":src.Workspace.Parameters,

‎cli/support_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ func assertBundleContents(t *testing.T, path string, wantWorkspace bool, wantAge
197197
varv derphealth.Report
198198
decodeJSONFromZip(t,f,&v)
199199
require.NotEmpty(t,v,"netcheck should not be empty")
200+
case"network/interfaces.json":
201+
varv healthsdk.InterfacesReport
202+
decodeJSONFromZip(t,f,&v)
203+
require.NotEmpty(t,v,"interfaces should not be empty")
200204
case"workspace/workspace.json":
201205
varv codersdk.Workspace
202206
decodeJSONFromZip(t,f,&v)

‎support/support.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ type Deployment struct {
4747

4848
typeNetworkstruct {
4949
ConnectionInfo workspacesdk.AgentConnectionInfo
50-
CoordinatorDebugstring`json:"coordinator_debug"`
51-
Netcheck*derphealth.Report`json:"netcheck"`
52-
TailnetDebugstring`json:"tailnet_debug"`
50+
CoordinatorDebugstring`json:"coordinator_debug"`
51+
Netcheck*derphealth.Report`json:"netcheck"`
52+
TailnetDebugstring`json:"tailnet_debug"`
53+
Interfaces healthsdk.InterfacesReport`json:"interfaces"`
5354
}
5455

5556
typeNetcheckstruct {
@@ -194,6 +195,15 @@ func NetworkInfo(ctx context.Context, client *codersdk.Client, log slog.Logger)
194195
returnnil
195196
})
196197

198+
eg.Go(func()error {
199+
rpt,err:=healthsdk.RunInterfacesReport()
200+
iferr!=nil {
201+
returnxerrors.Errorf("run interfaces report: %w",err)
202+
}
203+
n.Interfaces=rpt
204+
returnnil
205+
})
206+
197207
iferr:=eg.Wait();err!=nil {
198208
log.Error(ctx,"fetch network information",slog.Error(err))
199209
}

‎support/support_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func TestRun(t *testing.T) {
6666
assertNotNilNotEmpty(t,bun.Network.CoordinatorDebug,"network coordinator debug should be present")
6767
assertNotNilNotEmpty(t,bun.Network.Netcheck,"network netcheck should be present")
6868
assertNotNilNotEmpty(t,bun.Network.TailnetDebug,"network tailnet debug should be present")
69+
assertNotNilNotEmpty(t,bun.Network.Interfaces,"network interfaces health should be present")
6970
assertNotNilNotEmpty(t,bun.Workspace.Workspace,"workspace should be present")
7071
assertSanitizedWorkspace(t,bun.Workspace.Workspace)
7172
assertNotNilNotEmpty(t,bun.Workspace.BuildLogs,"workspace build logs should be present")
@@ -114,6 +115,7 @@ func TestRun(t *testing.T) {
114115
assertNotNilNotEmpty(t,bun.Network.CoordinatorDebug,"network coordinator debug should be present")
115116
assertNotNilNotEmpty(t,bun.Network.Netcheck,"network netcheck should be present")
116117
assertNotNilNotEmpty(t,bun.Network.TailnetDebug,"network tailnet debug should be present")
118+
assertNotNilNotEmpty(t,bun.Network.Interfaces,"network interfaces health should be present")
117119
assert.Empty(t,bun.Workspace.Workspace,"did not expect workspace to be present")
118120
assert.Empty(t,bun.Agent,"did not expect agent to be present")
119121
assertNotNilNotEmpty(t,bun.Logs,"bundle logs should be present")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp