feat: add --disable-direct flag to CLI (#8131)

This commit is contained in:
Dean Sheather
2023-06-21 20:22:43 +00:00
committed by GitHub
parent bc739bdfce
commit 24b95e16c4
11 changed files with 90 additions and 16 deletions
+5 -1
View File
@@ -195,8 +195,12 @@ func (r *RootCmd) ssh() *clibase.Cmd {
// We don't print the error because cliui.Agent does that for us.
}
if r.disableDirect {
_, _ = fmt.Fprintln(inv.Stderr, "Direct connections disabled.")
}
conn, err := client.DialWorkspaceAgent(ctx, workspaceAgent.ID, &codersdk.DialWorkspaceAgentOptions{
Logger: logger,
Logger: logger,
BlockEndpoints: r.disableDirect,
})
if err != nil {
return xerrors.Errorf("dial agent: %w", err)