Added spec.podTemplateSpec support to MCPRemoteProxy - #5531
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5531 +/- ##
==========================================
- Coverage 70.80% 70.79% -0.01%
==========================================
Files 685 685
Lines 69460 69592 +132
==========================================
+ Hits 49181 49269 +88
- Misses 16682 16714 +32
- Partials 3597 3609 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
03b0a06 to
9365a26
Compare
|
@Sanskarzz Thanks for this! Just wanted to add a comment so you don't think we've forgotten, just a bit busy atm. I'll be reviewing it soon enough though! 🚀 😆 |
|
Thanks @ChrisJBurns , no worries at all. Appreciate the update! I’ll keep an eye out for the review and will address any feedback once you get a chance to look at it. |
aponcedeleonch
left a comment
There was a problem hiding this comment.
Nice work. This is the last workload CRD missing podTemplateSpec, so it's a welcome parity fix, and the implementation mirrors the MCPServer reference closely. The logic checks out for me. Two things are blocking it right now, both mechanical:
- cmd/thv-operator/controllers/mcpremoteproxy_controller.go:398 has a gofmt slip (spaces instead of a tab on a closing brace), which fails the Lint job. A
task lint-fixshould sort it. - mcpremoteproxy_podtemplatespec_test.go references createRunConfigTestScheme, which no longer exists on main. It got renamed to testutil.NewScheme(t). Looks like merge rot, and it breaks the whole controllers test package, so the Test job is red too. Swapping to testutil.NewScheme(t) and adding the internal/testutil import fixes it.
I applied both locally and the new PodTemplateSpec tests plus the full controllers package go green, so once those land I think this is good to merge. One non-blocking nit: the rawPodTemplateSpecJSON helper unmarshals into a throwaway map and then discards it, so that validation is effectively dead code. Up to you.
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
|
Thanks for the review! Fixed both blocking issues:
|
* Add spec.podTemplateSpec support to MCPRemoteProxy Signed-off-by: Sanskarzz <sanskar.gur@gmail.com> * addressed review comments Signed-off-by: Sanskarzz <sanskar.gur@gmail.com> --------- Signed-off-by: Sanskarzz <sanskar.gur@gmail.com> Co-authored-by: Alejandro Ponce de Leon <aponcedeleonch@stacklok.com>
Covers the new spec.podTemplateSpec field added in stacklok/toolhive#5531. Adds a "Customize the remote proxy pod" section modeled on the parallel MCPServer pattern (container name toolhive, not mcp) and notes the new PodTemplateValid condition in the status section.
* Update stacklok/toolhive to v0.38.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Refresh reference assets for toolhive v0.38.0 * Document podTemplateSpec on MCPRemoteProxy for v0.37.0 Covers the new spec.podTemplateSpec field added in stacklok/toolhive#5531. Adds a "Customize the remote proxy pod" section modeled on the parallel MCPServer pattern (container name toolhive, not mcp) and notes the new PodTemplateValid condition in the status section. * Fix inaccurate example list in podTemplateSpec section spec.resources is a first-class field on MCPRemoteProxy, so listing resource limits among options 'not exposed as first-class fields' is misleading. Swap for affinity rules, which genuinely require podTemplateSpec. --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Summary
Add
spec.podTemplateSpecsupport toMCPRemoteProxyso remote proxy workloads can be customized like the other ToolHive workload CRDs.Although the issue calls out
v1alpha1, this branch definesv1alpha1.MCPRemoteProxy.Specasv1beta1.MCPRemoteProxySpec, so the API field is added to the sharedv1beta1spec. Regenerated CRDs expose the field in both served schema sections.Fixes #4549
Type of change
Test plan
task test)task test-e2e)task lint-fix)API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.Changes
spec.podTemplateSpectoMCPRemoteProxySpecusingruntime.RawExtensionwith unknown-field preservation.PodTemplateValidcondition type and valid/invalid reasons.controllerutil.ApplyPodTemplateSpecPatchstrategic merge helper.toolhive.stacklok.io/podtemplatespec-hashannotation.