ssh plugin: allow custom SSH port configuration#5047
ssh plugin: allow custom SSH port configuration#5047aadhil2k4 wants to merge 1 commit intovolcano-sh:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @aadhil2k4! It looks like this is your first PR to volcano-sh/volcano 🎉 |
Summary of ChangesHello @aadhil2k4, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the SSH plugin by enabling the configuration of a custom SSH port. This change provides crucial flexibility for users whose environments, especially those utilizing host networking, may have port 22 already in use. By allowing a non-standard port, the plugin ensures broader compatibility and smoother operation for SSH-dependent jobs. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new feature to allow configuring a custom SSH port via the --ssh-port flag, which is useful in environments where the default port 22 is already in use. The changes include updating the documentation, adding the new flag, and modifying the SSH config generation logic. The implementation is mostly correct, but I found a bug where the custom port is not applied when SSH keys are auto-generated. I've left a specific comment with a suggested fix for this issue.
There was a problem hiding this comment.
Pull request overview
This PR adds support for configuring a custom SSH port in the SSH plugin via the --ssh-port flag, addressing the need for non-standard SSH ports when port 22 is already in use (e.g., when using host networking).
Changes:
- Added
sshPortfield to the SSH plugin structure with a default value of 22 - Modified
generateRsaKeyandwithUserProvidedRsaKeyfunctions to accept a port parameter - Updated
generateSSHConfigto include the port configuration in the SSH config output - Added test coverage for the custom SSH port flag parsing
- Updated documentation to describe the new
--ssh-portflag
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/controllers/job/plugins/ssh/ssh.go | Adds sshPort field, flag parsing, and passes port to key generation functions |
| pkg/controllers/job/plugins/ssh/ssh_test.go | Adds test case to verify custom port flag parsing |
| docs/user-guide/how_to_use_ssh_plugin.md | Documents the new ssh-port parameter and updates example config output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
50bb45c to
13aba1b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hajnalmt
left a comment
There was a problem hiding this comment.
Hello @aadhil2k4,
Thank you for the contribution overall looks good, please fix copilot's suggestion they are needed and we can merge it 👍!
13aba1b to
215a5db
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds support for custom SSH port via `--ssh-port` flag. Default port remains 22. Validates the port range and falls back to the default when an invalid port is provided. Signed-off-by: Aadhil Ahamed <aadhil2k4@gmail.com>
215a5db to
6b368cb
Compare
|
@hajnalmt I have made the changes. |
What type of PR is this?
Feature
What this PR does / why we need it:
This PR adds support for configuring a custom SSH port in the SSH plugin via the
--ssh-portflag.This is useful when host networking is used and port 22 is pre occupied, allowing jobs to use a non standard SSH port.
Which issue(s) this PR fixes:
Fixes #2492
Special notes for your reviewer:
Does this PR introduce a user-facing change?