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

fix(agent/agentssh): allow remote forwarding a socket multiple times#11631

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 5 commits intomainfrommafredri/fix-socket-re-forward
Jan 16, 2024

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedJan 16, 2024
edited
Loading

Fixes#11198
Fixeshttps://github.com/coder/customers/issues/407

For this PR, I implemented a new test incli/ssh_test.go, however, in future, we should consider doing more extensive testing for forwarding within theagent/agentssh package.

@mafredrimafredriforce-pushed themafredri/fix-socket-re-forward branch from96c0724 todab6034CompareJanuary 16, 2024 10:06
@mafredrimafredri marked this pull request as ready for reviewJanuary 16, 2024 10:14
// Ensure the SSH connection is ready by testing the shell
// input/output.
pty.WriteLine("echo ping' 'pong")
pty.ExpectMatchContext(ctx, "ping pong")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

using the CLI to test the agent is awkward and this is an example. This test would be easier to write and easier to understand if were inagent_test.go and we could use the go ssh client.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I do somewhat agree, but I'm not sureagent_test.go is a much better place since the actual forwarding is implemented here, incli/remoteforward.go. This test should ensure that the behavior we want works with the actualcoder ssh client.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We already have tests forcoder ssh in terms of making a unix socket remote forward and verifying it works. None of that behavior is changing in this PR.

What's changing is on the agent side of the connection. And it's not justcoder ssh that talks to that SSH server: it could be OpenSSH or JetBrains Gateway or VSCode (viacoder ssh --stdio), or even a custom SSH client written in go usingcodersdk. Therefore, we need to think about the required behavior in terms of what the SSH server is supposed to do, not just end-to-end with a specific client.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, I'm not opposed tbh. I think the best place for most of this testing is within theagentssh package itself. I'll create an issue for this since if we go this route, there's some other restructuring that needs to be done as well. Like moving the forwarding logic fromcli toagentssh, etc. Otherwise I think we'll end up with "many implementations of an SSH client".

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
Contributor

@spikecurtisspikecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

One thing to fixup; but I don't need to review again.

@mafredrimafredri mentioned this pull requestJan 16, 2024
@mafredrimafredri merged commit385d58c intomainJan 16, 2024
@mafredrimafredri deleted the mafredri/fix-socket-re-forward branchJanuary 16, 2024 19:26
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 16, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@spikecurtisspikecurtisspikecurtis approved these changes

@deansheatherdeansheatherAwaiting requested review from deansheather

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Allow new RemoteForward to override existing RemoteForward in Coder Agent
2 participants
@mafredri@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp