-
Notifications
You must be signed in to change notification settings - Fork 894
feat: add custom coder bin path for ProxyCommand #8425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
252f4f3
ee99527
45bd452
d400d11
a7a435e
d9e1285
de4d628
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,7 @@ func (r *RootCmd) configSSH() *clibase.Cmd { | |
dryRun bool | ||
skipProxyCommand bool | ||
forceUnixSeparators bool | ||
coderCliPath string | ||
) | ||
client := new(codersdk.Client) | ||
cmd := &clibase.Cmd{ | ||
|
@@ -233,10 +234,16 @@ func (r *RootCmd) configSSH() *clibase.Cmd { | |
// that it's possible to capture the diff. | ||
out = inv.Stderr | ||
} | ||
coderBinary, err := currentBinPath(out) | ||
if err != nil { | ||
return err | ||
|
||
var err error | ||
coderBinary := coderCliPath | ||
if coderBinary == "" { | ||
coderBinary, err = currentBinPath(out) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
|
||
escapedCoderBinary, err := sshConfigExecEscape(coderBinary, forceUnixSeparators) | ||
if err != nil { | ||
return xerrors.Errorf("escape coder binary for ssh failed: %w", err) | ||
|
@@ -501,6 +508,14 @@ func (r *RootCmd) configSSH() *clibase.Cmd { | |
Description: "Specifies the path to an SSH config.", | ||
Value: clibase.StringOf(&sshConfigFile), | ||
}, | ||
{ | ||
Flag: "coder-cli-path", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about just using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing I was trying to make clear in the flag was this was the Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah, not too long IMO, your reasoning makes sense 👍🏻 |
||
Env: "CODER_SSH_CONFIG_CLI_PATH", | ||
Default: "", | ||
Description: "Optional to specify the path for the coder cli uses in ProxyCommand. " + | ||
"By default, the coder cli used is the same cli being invoked with 'config ssh'.", | ||
Emyrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Value: clibase.StringOf(&coderCliPath), | ||
}, | ||
{ | ||
Flag: "ssh-option", | ||
FlagShorthand: "o", | ||
|
Uh oh!
There was an error while loading. Please reload this page.