Skip to content

Replace ReferencingServers with structured ReferencingWorkloads on MCPOIDCConfig#4492

Merged
ChrisJBurns merged 1 commit into
mainfrom
chrisburns/mcpoidcconfig-workload-reference
Apr 2, 2026
Merged

Replace ReferencingServers with structured ReferencingWorkloads on MCPOIDCConfig#4492
ChrisJBurns merged 1 commit into
mainfrom
chrisburns/mcpoidcconfig-workload-reference

Conversation

@ChrisJBurns
Copy link
Copy Markdown
Collaborator

Summary

  • RFC-0023 specifies a structured referencingWorkloads list with kind and name fields on shared configuration CRD status, rather than plain []string with string prefix conventions. This introduces a WorkloadReference type and migrates MCPOIDCConfig from ReferencingServers []string to ReferencingWorkloads []WorkloadReference.
  • The MCPServer controller and MCPOIDCConfig controller are updated to build, compare, and track structured WorkloadReference entries throughout: reference tracking, deletion protection, watch handlers, and status updates.
  • The WorkloadReference type is reusable by MCPToolConfig, MCPTelemetryConfig, and MCPExternalAuthConfig in follow-up work (Migrate ReferencingServers to ReferencingWorkloads on remaining CRDs #4491).

Type of change

  • Refactoring (no behavior change)

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Changes

File Change
api/v1alpha1/mcpoidcconfig_types.go Add WorkloadReference struct; rename ReferencingServers []stringReferencingWorkloads []WorkloadReference
controllers/mcpoidcconfig_controller.go Rename findReferencingServersfindReferencingWorkloads; update watch handler, deletion handling, status updates
controllers/mcpserver_controller.go Rename updateOIDCConfigReferencingServersupdateOIDCConfigReferencingWorkloads; use WorkloadReference{Kind: "MCPServer"}
controllers/mcpserver_oidcconfig_test.go Update unit tests for WorkloadReference
test-integration/mcp-oidc-config/mcpoidcconfig_mcpserver_integration_test.go Update integration tests for WorkloadReference
test-integration/mcp-oidc-config/mcpoidcconfig_controller_integration_test.go Extract conditionTypeValid constant

Does this introduce a user-facing change?

Yes — the MCPOIDCConfig status field referencingServers (plain string array) is replaced with referencingWorkloads (structured array with kind and name fields). This is a status-only change; the spec API is unchanged.

Special notes for reviewers

  • This is PR 1 of 2. PR 2 (VirtualMCPServer wiring to MCPOIDCConfig) will be stacked on this branch.
  • The WorkloadReference type is defined with an enum validation for Kind (MCPServer, VirtualMCPServer, MCPRemoteProxy) to support all current workload types.
  • Follow-up issue Migrate ReferencingServers to ReferencingWorkloads on remaining CRDs #4491 tracks the same migration for MCPToolConfig, MCPTelemetryConfig, and MCPExternalAuthConfig.

Generated with Claude Code

@github-actions github-actions Bot added the size/S Small PR: 100-299 lines changed label Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 65.38462% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.35%. Comparing base (26f6e1e) to head (1f94b73).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...v-operator/controllers/mcpoidcconfig_controller.go 64.70% 5 Missing and 1 partial ⚠️
...d/thv-operator/controllers/mcpserver_controller.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4492      +/-   ##
==========================================
+ Coverage   69.31%   69.35%   +0.03%     
==========================================
  Files         502      502              
  Lines       51632    51635       +3     
==========================================
+ Hits        35791    35811      +20     
+ Misses      13075    13058      -17     
  Partials     2766     2766              

☔ View full report in Codecov by Sentry.
📢 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.

JAORMX
JAORMX previously approved these changes Apr 2, 2026
…POIDCConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields rather than plain strings. This replaces the
ReferencingServers []string field on MCPOIDCConfig with
ReferencingWorkloads []WorkloadReference, a new type with Kind and Name
fields that explicitly identifies each referencing workload.

The WorkloadReference type supports MCPServer, VirtualMCPServer, and
MCPRemoteProxy kinds, making the data model self-describing and
type-safe. The MCPServer controller and MCPOIDCConfig controller are
updated to use the new structured type throughout: reference tracking,
deletion protection, watch handlers, and status updates.

The same migration is needed for MCPToolConfig, MCPTelemetryConfig, and
MCPExternalAuthConfig — tracked in #4491.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns force-pushed the chrisburns/mcpoidcconfig-workload-reference branch from 3079635 to 1f94b73 Compare April 2, 2026 14:50
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Apr 2, 2026
@ChrisJBurns ChrisJBurns merged commit 610075f into main Apr 2, 2026
69 of 71 checks passed
@ChrisJBurns ChrisJBurns deleted the chrisburns/mcpoidcconfig-workload-reference branch April 2, 2026 17:11
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…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>
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…PExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in #4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes #4491

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…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>
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…PExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in #4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes #4491

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…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>
ChrisJBurns added a commit that referenced this pull request Apr 2, 2026
…PExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in #4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes #4491

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns added a commit that referenced this pull request Apr 3, 2026
…#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 #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>
ChrisJBurns added a commit that referenced this pull request Apr 3, 2026
…thConfig (#4507)

Replace ReferencingServers with structured ReferencingWorkloads on MCPExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in #4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes #4491

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisJBurns added a commit that referenced this pull request Apr 3, 2026
The printer columns for Ready and References on MCPOIDCConfig still
pointed at the old condition type (Valid) and status field
(referencingServers) after they were renamed in PRs #4490 and #4492.
This caused both columns to show empty in kubectl output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
MatteoManzoni pushed a commit to DocPlanner/toolhive that referenced this pull request Apr 4, 2026
…thConfig (stacklok#4507)

Replace ReferencingServers with structured ReferencingWorkloads on MCPExternalAuthConfig

RFC-0023 specifies a structured referencingWorkloads list with kind and
name fields on shared configuration CRD status. This migrates
MCPExternalAuthConfig from plain []string to []WorkloadReference,
following the pattern already implemented for MCPOIDCConfig in stacklok#4492.

The deletion handler now uses a DeletionBlocked condition with reason
ReferencedByWorkloads and requeues instead of returning an error. The
watch handler also enqueues configs with stale ReferencingWorkloads
entries to handle ref-removal and server-deletion cases.

Closes stacklok#4491

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants