Skip to content

Added spec.podTemplateSpec support to MCPRemoteProxy#5531

Open
Sanskarzz wants to merge 1 commit into
stacklok:mainfrom
Sanskarzz:addpodtemplate
Open

Added spec.podTemplateSpec support to MCPRemoteProxy#5531
Sanskarzz wants to merge 1 commit into
stacklok:mainfrom
Sanskarzz:addpodtemplate

Conversation

@Sanskarzz

Copy link
Copy Markdown
Contributor

Summary

Add spec.podTemplateSpec support to MCPRemoteProxy so remote proxy workloads can be customized like the other ToolHive workload CRDs.

Although the issue calls out v1alpha1, this branch defines v1alpha1.MCPRemoteProxy.Spec as v1beta1.MCPRemoteProxySpec, so the API field is added to the shared v1beta1 spec. Regenerated CRDs expose the field in both served schema sections.

Fixes #4549

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Changes

  • Added optional spec.podTemplateSpec to MCPRemoteProxySpec using runtime.RawExtension with unknown-field preservation.
  • Added MCPRemoteProxy-specific PodTemplateValid condition type and valid/invalid reasons.
  • Validates PodTemplateSpec early in the MCPRemoteProxy reconcile path and blocks Deployment updates when invalid.
  • Applies valid PodTemplateSpec customizations to the generated Deployment using the existing controllerutil.ApplyPodTemplateSpecPatch strategic merge helper.
  • Tracks raw PodTemplateSpec changes with the shared toolhive.stacklok.io/podtemplatespec-hash annotation.
  • Added focused tests for validation, merge behavior, fields outside the builder emptiness check, and drift detection.
  • Regenerated deepcopy, CRDs, Helm CRD templates, and CRD reference docs.

@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.68421% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.75%. Comparing base (66c397b) to head (9365a26).

Files with missing lines Patch % Lines
...-operator/controllers/mcpremoteproxy_controller.go 76.36% 14 Missing and 12 partials ⚠️
...-operator/controllers/mcpremoteproxy_deployment.go 60.86% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5531      +/-   ##
==========================================
- Coverage   69.75%   69.75%   -0.01%     
==========================================
  Files         646      646              
  Lines       65697    65824     +127     
==========================================
+ Hits        45830    45915      +85     
- Misses      16522    16547      +25     
- Partials     3345     3362      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PodTemplateSpec to MCPRemoteProxy

1 participant