Wire MCPOIDCConfig into VirtualMCPServer controller#4493
Merged
Conversation
Contributor
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.
3079635 to
1f94b73
Compare
cd948c6 to
129c9bb
Compare
Base automatically changed from
chrisburns/mcpoidcconfig-workload-reference
to
main
April 2, 2026 17:11
VirtualMCPServer can now reference a shared MCPOIDCConfig resource via incomingAuth.oidcConfigRef, matching the pattern already established for MCPServer. The legacy inline oidcConfig field is deprecated and will be removed in v1beta1. Key changes: - Add oidcConfigRef field to IncomingAuthConfig with CEL mutual-exclusivity validation against the deprecated oidcConfig field - Converter resolves OIDC config from MCPOIDCConfig references using ResolveFromConfigRef, including client secret and CA bundle handling - VirtualMCPServer controller validates the referenced MCPOIDCConfig, tracks config hash changes, and watches for MCPOIDCConfig updates - MCPOIDCConfig controller now tracks VirtualMCPServer references in ReferencingWorkloads and blocks deletion while referenced - Deployment builder propagates errors from MCPOIDCConfig fetch failures rather than silently producing misconfigured deployments Closes #4253 Closes #4248 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
129c9bb to
059629c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4493 +/- ##
==========================================
- Coverage 69.34% 69.05% -0.30%
==========================================
Files 502 502
Lines 51643 51869 +226
==========================================
+ Hits 35814 35816 +2
- Misses 13063 13273 +210
- Partials 2766 2780 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jerm-dro
approved these changes
Apr 2, 2026
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
Closes #4253
Closes #4248
Stacked on #4492 — merge that first.
Type of change
Test plan
task test)task lint-fix)test-integration/mcp-oidc-config/)Changes
api/v1alpha1/virtualmcpserver_types.gooidcConfigReffield toIncomingAuthConfigwith CEL mutual-exclusivity validation; deprecateoidcConfig; addOIDCConfigHashto statuscontrollers/virtualmcpserver_controller.gohandleOIDCConfigfor reference validation, hash tracking, and ReferencingWorkloads updates; add MCPOIDCConfig watch handler and RBACcontrollers/virtualmcpserver_deployment.gobuildOIDCEnvVars,buildVolumesForVmcp, andvalidateSecretReferencesto handle MCPOIDCConfig inline client secrets and CA bundles; propagate errorscontrollers/mcpoidcconfig_controller.gofindReferencingWorkloadsto include VirtualMCPServers; add VirtualMCPServer watch for reference trackingpkg/vmcpconfig/converter.goOIDCConfigRefresolution branch inconvertIncomingAuthusingResolveFromConfigRef; addmapResolvedOIDCToVmcpConfigFromReftest-integration/mcp-oidc-config/suite_test.gotest-integration/mcp-oidc-config/mcpoidcconfig_virtualmcpserver_integration_test.goDoes this introduce a user-facing change?
Yes. VirtualMCPServer now supports
spec.incomingAuth.oidcConfigRefto reference a shared MCPOIDCConfig resource for OIDC authentication. The inlinespec.incomingAuth.oidcConfigfield is deprecated and will be removed in v1beta1. The two fields are mutually exclusive.Special notes for reviewers
mapResolvedOIDCToVmcpConfigFromReffunction is intentionally separate frommapResolvedOIDCToVmcpConfigbecause client secret detection differs: the MCPOIDCConfig path checksMCPOIDCConfig.Spec.Inline.ClientSecretRefrather thanOIDCConfigRef.Inline.ClientSecretRef.handleOIDCConfigmethod follows the same pattern asMCPServerReconciler.handleOIDCConfigbut uses theStatusManagerinterface for batched status updates.buildVolumesForVmcp,buildOIDCEnvVars,buildEnvVarsForVmcp) return errors instead of silently dropping MCPOIDCConfig fetch failures, unlike the MCPServer controller which uses the silent-swallow pattern.Generated with Claude Code