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

Commita551aa5

Browse files
authored
fix: respect --disable-direct-connections on coder speedtest (coder#13377)
1 parentec78f54 commita551aa5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎cli/speedtest.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func (r *RootCmd) speedtest() *serpent.Command {
3939
ctx,cancel:=context.WithCancel(inv.Context())
4040
defercancel()
4141

42+
ifdirect&&r.disableDirect {
43+
returnxerrors.Errorf("--direct (-d) is incompatible with --%s",varDisableDirect)
44+
}
45+
4246
_,workspaceAgent,err:=getWorkspaceAndAgent(ctx,inv,client,false,inv.Args[0])
4347
iferr!=nil {
4448
returnerr
@@ -57,12 +61,13 @@ func (r *RootCmd) speedtest() *serpent.Command {
5761
logger=logger.Leveled(slog.LevelDebug)
5862
}
5963

60-
ifr.disableDirect {
61-
_,_=fmt.Fprintln(inv.Stderr,"Direct connections disabled.")
62-
}
6364
opts:=&workspacesdk.DialAgentOptions{
6465
Logger:logger,
6566
}
67+
ifr.disableDirect {
68+
_,_=fmt.Fprintln(inv.Stderr,"Direct connections disabled.")
69+
opts.BlockEndpoints=true
70+
}
6671
ifpcapFile!="" {
6772
s:=capture.New()
6873
opts.CaptureHook=s.LogPacket

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp