Support publishing additional container ports in thv run#3892
Support publishing additional container ports in thv run#3892JAORMX merged 6 commits intostacklok:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3892 +/- ##
==========================================
- Coverage 69.52% 69.48% -0.04%
==========================================
Files 480 480
Lines 48978 49025 +47
==========================================
+ Hits 34051 34066 +15
- Misses 12302 12331 +29
- Partials 2625 2628 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jerm-dro
left a comment
There was a problem hiding this comment.
Mostly LGTM to me. Can you manually verify this fixes the user's reported issue by running this locally? A series of screenshots or video will do.
It looks like I need to create one or two MCP servers that are exposed on multiple ports. One of them is @jerm-dro, if you have a similar MCP server in your inventory that exposes multiple ports, could you please share it? |
jerm-dro
left a comment
There was a problem hiding this comment.
Thanks for including the screenshots of the manual validation 😃
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
|
✅ PR size has been reduced below the XL threshold. The size review has been dismissed and this PR can now proceed with normal review. Thank you for splitting this up! |
PR size has been reduced below the XL threshold. Thank you for splitting this up!
|
@Sanskarzz This is approved but it looks like the branch has merge conflicts and CI hasn't run on the latest commit. Can you rebase against main, run |
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@jerm-dro I have rebased and executed task docs, but no new docs were generated. CI is green now. |

Fix: #3812
Summary
This PR adds support for the
--publish / -pflag to thethv runcommand, enabling users to expose arbitrary container ports to the host, similar todocker run -p. It also fixes a bug in the Docker runtime client where explicitly requested host ports were being overwritten by random ports.Key Changes
--publishflag tothv run.networking.ParsePortSpecfor robust port specification parsing.runtime.Setupto handle multiple port bindings efficiently.pkg/container/docker/client.goto respect existingHostPortassignments ingeneratePortBindings.