Skip to content

Disable ssh port forwarding when value of -ssh-port is -1#403

Merged
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
vyasgun:pr/ssh-port
Oct 7, 2024
Merged

Disable ssh port forwarding when value of -ssh-port is -1#403
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
vyasgun:pr/ssh-port

Conversation

@vyasgun
Copy link
Copy Markdown
Member

@vyasgun vyasgun commented Oct 4, 2024

This is a fix for #402

The default value for the flag is 2222 which should not happen when -1 is provided.

Tested as follows:

gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % bin/gvproxy -debug -listen unix:///tmp/network.sock -listen-qemu tcp://0.0.0.0:1234 -ssh-port 55556
INFO[0000] gvproxy version gitd1683b9b-dirty
INFO[0000] waiting for clients...
INFO[0000] listening unix:///tmp/network.sock


gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % lsof -i :55556
COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
gvproxy 60527 gvyas    7u  IPv4 0xef6992879c346520      0t0  TCP localhost:55556 (LISTEN)
gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % bin/gvproxy -debug -listen unix:///tmp/network.sock -listen-qemu tcp://0.0.0.0:1234
INFO[0000] gvproxy version gitd1683b9b-dirty
INFO[0000] waiting for clients...
INFO[0000] listening unix:///tmp/network.sock


gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % lsof -i :2222
COMMAND   PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
gvproxy 60743 gvyas    7u  IPv4 0xb6a79b454352e9f5      0t0  TCP localhost:rockwell-csp2 (LISTEN)
gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % bin/gvproxy -debug -listen unix:///tmp/network.sock -listen-qemu tcp://0.0.0.0:1234 -ssh-port -1
INFO[0000] gvproxy version gitd1683b9b-dirty
INFO[0000] waiting for clients...
INFO[0000] listening unix:///tmp/network.sock


gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock % lsof -i :2222
gvyas@Gunjans-MacBook-Pro gvisor-tap-vsock %

@vyasgun vyasgun force-pushed the pr/ssh-port branch 3 times, most recently from f49a19e to 802e3ad Compare October 4, 2024 13:22
@cfergeau
Copy link
Copy Markdown
Collaborator

cfergeau commented Oct 4, 2024

The "DCO" failure can be fixed if you amend your commit with git commit --amend -s

Copy link
Copy Markdown
Collaborator

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

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

Looks good to me!
A Signed-off-by needs to be added to this commit.

Signed-off-by: Gunjan Vyas <vyasgun20@gmail.com>
@vyasgun
Copy link
Copy Markdown
Member Author

vyasgun commented Oct 4, 2024

@cfergeau thanks, updated!

@openshift-ci openshift-ci bot added the approved label Oct 4, 2024
@cfergeau
Copy link
Copy Markdown
Collaborator

cfergeau commented Oct 7, 2024

/lgtm
/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Oct 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfergeau, vyasgun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit a89bb10 into containers:main Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants