Replace ReferencingServers with ReferencingWorkloads on MCPToolConfig#4506
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4506 +/- ##
==========================================
+ Coverage 69.04% 69.06% +0.01%
==========================================
Files 502 502
Lines 51909 51924 +15
==========================================
+ Hits 35843 35859 +16
- Misses 13279 13283 +4
+ Partials 2787 2782 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4379e2c to
ed2b9b2
Compare
…PToolConfig Migrate MCPToolConfig from plain string server names to structured WorkloadReference entries (kind + name) per RFC-0023, following the pattern already implemented on MCPOIDCConfig in PR #4492. - Replace ReferencingServers []string with ReferencingWorkloads []WorkloadReference - Add findReferencingWorkloads returning []WorkloadReference - Update handleDeletion to use DeletionBlocked condition with ReferencedByWorkloads reason - Update watch handler to check ref.Kind and ref.Name for stale entry cleanup - Update unit, edge-case, and integration tests for WorkloadReference assertions - Regenerate deepcopy, CRD manifests, and Helm templates Closes #4491 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ed2b9b2 to
a5baa39
Compare
jerm-dro
approved these changes
Apr 2, 2026
4 tasks
3 tasks
MatteoManzoni
pushed a commit
to DocPlanner/toolhive
that referenced
this pull request
Apr 4, 2026
…stacklok#4506) Replace ReferencingServers with structured ReferencingWorkloads on MCPToolConfig Migrate MCPToolConfig from plain string server names to structured WorkloadReference entries (kind + name) per RFC-0023, following the pattern already implemented on MCPOIDCConfig in PR stacklok#4492. - Replace ReferencingServers []string with ReferencingWorkloads []WorkloadReference - Add findReferencingWorkloads returning []WorkloadReference - Update handleDeletion to use DeletionBlocked condition with ReferencedByWorkloads reason - Update watch handler to check ref.Kind and ref.Name for stale entry cleanup - Update unit, edge-case, and integration tests for WorkloadReference assertions - Regenerate deepcopy, CRD manifests, and Helm templates Closes stacklok#4491 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates MCPToolConfig from
ReferencingServers []stringtoReferencingWorkloads []WorkloadReference, aligning it with the structured workload reference pattern established on MCPOIDCConfig in #4492. This enables the status field to distinguish between different workload kinds (MCPServer, VirtualMCPServer, MCPRemoteProxy) rather than assuming all referencing workloads are MCPServers.Partial fix for #4491
Type of change
Changes
toolconfig_types.goReferencingServers []stringwithReferencingWorkloads []WorkloadReference, update printer columntoolconfig_controller.gofindReferencingWorkloads(), update reconcile/deletion logic to use structured refs withDeletionBlockedconditiontoolconfig_controller_test.goWorkloadReference{Kind, Name}structstoolconfig_controller_edge_cases_test.goWorkloadReference{Kind, Name}structsmcptoolconfig_controller_integration_test.goWorkloadReference{Kind, Name}structsTest plan
go test ./cmd/thv-operator/controllers/... -run ToolConfig)task genSpecial notes for reviewers
Follows the exact pattern from #4492 (MCPOIDCConfig migration). MCPExternalAuthConfig migration is in a separate PR. MCPTelemetryConfig will follow separately.
Generated with Claude Code