Repository navigation
Remove deprecated fields from MCPServer and MCPRemoteProxy CRDs - #4467
Conversation
The v1alpha2 API is a breaking change and the right time to drop deprecated fields that were retained for backward compatibility. Remove six deprecated CRD fields and their fallback helper logic: - MCPServer.spec.port → use proxyPort - MCPServer.spec.targetPort → use mcpPort - MCPServer.spec.toolsFilter → use toolConfigRef + MCPToolConfig - InlineOIDCConfig.clientSecret → use clientSecretRef (SecretKeyRef) - InlineOIDCConfig.thvCABundlePath → use caBundleRef (ConfigMap) - MCPRemoteProxy.spec.port → use proxyPort Simplify GetProxyPort() and GetMcpPort() helpers to use only the canonical fields. Update all controllers, OIDC resolver, vMCP converter, export logic, tests, CRD schemas, examples, and docs. Fixes #4250 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
The migration notes are better suited for the PR description where they are visible to reviewers alongside the breaking change context. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
PR size has been reduced below the XL threshold. Thank you for splitting this up!
|
✅ 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! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4467 +/- ##
==========================================
- Coverage 69.64% 69.62% -0.03%
==========================================
Files 491 491
Lines 50304 50270 -34
==========================================
- Hits 35036 34999 -37
- Misses 12580 12592 +12
+ Partials 2688 2679 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
The v1alpha2 API is a breaking change, making this the right time to remove deprecated CRD fields that were retained during v1alpha1 for backward compatibility. Keeping them creates API ambiguity and, in the case of
clientSecret, a security liability (plaintext secrets in CRD specs visible in etcd and audit logs).MCPServer.spec.port,targetPort,toolsFilter,InlineOIDCConfig.clientSecret,thvCABundlePath, andMCPRemoteProxy.spec.portGetProxyPort()andGetMcpPort()helpers to use only the canonical fieldsFixes #4250
Type of change
Test plan
task test)task lint-fix)Verified
go build ./...andgo vet ./...pass cleanly. Ran unit tests for all 7 changed packages (api/v1alpha1, controllers, pkg/oidc, pkg/vmcpconfig, pkg/controllerutil, pkg/export, pkg/vmcp/workloads) — all pass. Integration tests require kubebuilder/etcd which is not available locally. Confirmed no deprecated field references remain in production Go code, CRD YAML schemas, or example manifests.Changes
cmd/thv-operator/api/v1alpha1/mcpserver_types.goPort,TargetPort,ToolsFilterfromMCPServerSpec; removeClientSecret,ThvCABundlePathfromInlineOIDCConfig; simplifyGetProxyPort(),GetMcpPort()cmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.goPortfromMCPRemoteProxySpec; simplifyGetProxyPort()cmd/thv-operator/api/v1alpha1/zz_generated.deepcopy.goToolsFilterdeepcopy blockcmd/thv-operator/controllers/mcpserver_runconfig.gocmd/thv-operator/controllers/virtualmcpserver_deployment.gocmd/thv-operator/pkg/oidc/resolver.gocmd/thv-operator/pkg/vmcpconfig/converter.gopkg/export/k8s.gopkg/vmcp/workloads/k8s.goGetProxyPort()instead of direct field access with fallbackdeploy/charts/operator-crds/**docs/operator/crd-api.mdexamples/operator/***_test.go(14 files)Does this introduce a user-facing change?
Yes. Users referencing deprecated field names in MCPServer or MCPRemoteProxy manifests must migrate to the canonical replacements. See migration guide below.
Migration Guide
Field Mappings
spec.portspec.proxyPortspec.targetPortspec.mcpPortspec.tools(ToolsFilter)spec.toolConfigRef+ MCPToolConfigspec.oidcConfig.inline.clientSecretspec.oidcConfig.inline.clientSecretRefspec.oidcConfig.inline.thvCABundlePathspec.oidcConfig.inline.caBundleRefspec.portspec.proxyPortPort fields (
port→proxyPort,targetPort→mcpPort)Replace directly in your manifests:
Tools filter (
tools→toolConfigRef+ MCPToolConfig)Create a separate MCPToolConfig resource and reference it:
Client secret (
clientSecret→clientSecretRef)Store the client secret in a Kubernetes Secret and reference it:
CA bundle path (
thvCABundlePath→caBundleRef)Store the CA certificate in a ConfigMap and reference it:
ToolHive automatically mounts the ConfigMap and computes the CA bundle path.
Special notes for reviewers
OIDCConfigstruct inpkg/oidc/resolver.gointentionally retainsClientSecretandThvCABundlePathfields — these are internal resolved values used by the ConfigMap OIDC path, not CRD fields.if port > 0check inpkg/vmcp/workloads/k8s.goafterGetProxyPort()is now technically always true (returns >= 8080), but is harmless and left for clarity.task operator-manifests; API docs viatask crdref-gen.Generated with Claude Code