Wire MCPOIDCConfig into MCPRemoteProxy controller#4509
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4509 +/- ##
==========================================
- Coverage 69.06% 68.85% -0.22%
==========================================
Files 502 505 +3
Lines 51997 52322 +325
==========================================
+ Hits 35913 36026 +113
- Misses 13300 13499 +199
- Partials 2784 2797 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
|
@claude please review this PR. Only report on critical/high issues and non-controversial medium issues. Ignore low and informational issues related to style or preference. At the end, recommend either approval or rejection. |
|
Claude finished @ChrisJBurns's task in 4m 1s —— View job PR Review: Wire MCPOIDCConfig into MCPRemoteProxy controller
SummaryThis PR completes the OIDC config ref pattern across all three workload types (MCPServer, VirtualMCPServer, MCPRemoteProxy). The implementation is faithful to the sibling PRs and the overall structure is sound. No critical or high issues found. Medium Issue: Stale condition not removed when
|
|
@claude please re-review. The previous feedback has been addressed: stale condition removal on ref clear, large PR justification added, CEL mutual exclusivity validation, optional pointer type for oidcConfig, and shared condition constants. |
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
|
Claude finished @ChrisJBurns's task in 1m 22s —— View job Re-review: Wire MCPOIDCConfig into MCPRemoteProxy controller
Previous Issues — All Addressed
No New Issues FoundThe nil guards in The previously noted unreachable nil check at line ~749 is a cosmetic carry-over from the sibling controllers — not a blocker. Verdict: ApproveAll critical and medium issues from the previous review have been resolved. The implementation is correct, consistent with the MCPServer and VirtualMCPServer patterns, and the integration tests now cover the full lifecycle including condition cleanup on ref removal. |
MCPOIDCConfig was already wired into MCPServer and VirtualMCPServer but MCPRemoteProxy was missing support for referencing shared OIDC config. This adds the same pattern: types, controller lifecycle, runconfig resolution, and bidirectional watches. Closes #4275 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regenerate CRD manifests, Helm chart templates, DeepCopy methods, and CRD API docs after adding OIDCConfigRef to MCPRemoteProxy. Add integration tests covering the full MCPOIDCConfig + MCPRemoteProxy cross-CRD lifecycle: happy path, fail-closed, hash cascade, deletion protection, and reference cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add CEL XValidation rule enforcing mutual exclusivity between oidcConfig and oidcConfigRef - Make oidcConfig optional (pointer type) with deprecation notice, matching the MCPServer pattern from PR #4481 - Reuse shared OIDC condition constants from MCPServer types instead of introducing duplicate per-type constants - Use ConditionReasonOIDCConfigRefNotValid (matching MCPServer/vMCP) instead of the divergent OIDCConfigRefNotReady - Add nil guards in validation methods for the now-optional oidcConfig - Fix all downstream value→pointer type changes in tests and helpers - Regenerate CRDs, Helm templates, DeepCopy, and API docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When OIDCConfigRef is removed from an MCPRemoteProxy, the condition was left behind in status. Now calls meta.RemoveStatusCondition to match the pattern used by handleToolConfig and handleExternalAuthConfig. Integration test updated to assert the condition is removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d009deb to
500ab99
Compare
Replace hardcoded "MCPRemoteProxy" strings with the shared constant from PR #4520 for consistency with all other controllers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests were setting both oidcConfig and oidcConfigRef on MCPRemoteProxy, which is now rejected by the CEL XValidation rule. Use only oidcConfigRef when testing the shared config path, and switch to inline oidcConfig when testing reference removal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1968b8a to
8ec285c
Compare
- Only set oidcConfigRef (not both fields) when testing shared config - Set inline oidcConfig when switching back on reference removal - Remove not-ready test: inherently racy since the controller immediately reconciles the config back to Ready=True. The missing config test already covers the fail-closed path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
MCPOIDCConfigresources. MCPServer (Wire MCPOIDCConfig into MCPServer controller #4481) and VirtualMCPServer (Wire MCPOIDCConfig into VirtualMCPServer controller #4493) already had this wiring. This PR completes the set so platform teams can define OIDC configuration once and reference it from all three workload types.OIDCConfigReffield to MCPRemoteProxy spec,OIDCConfigHashto status, controller lifecycle (fail-closed validation, hash tracking, condition management), bidirectional watches between MCPOIDCConfig and MCPRemoteProxy controllers, and runconfig resolution supporting both the new ref path and legacy inline config.oidcConfigoptional (pointer) with deprecation notice and adds CEL mutual exclusivity validation withoidcConfigRef, matching the MCPServer pattern.Ref #4275
Type of change
Large PR Justification
This PR exceeds the normal line limit because:
The core production logic is ~330 lines across 4 files, within the normal limit. The tests and generated content are not meaningfully splittable.
Test plan
task test)task lint-fix)Changes
cmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.goOIDCConfigRefspec field, makeOIDCConfigoptional pointer with deprecation, CEL mutual exclusivity rule,OIDCConfigHashstatus fieldcmd/thv-operator/controllers/mcpremoteproxy_controller.gohandleOIDCConfig,updateOIDCConfigReferencingWorkloads,mapOIDCConfigToMCPRemoteProxy; RBAC markers; wire intovalidateAndHandleConfigsandSetupWithManagercmd/thv-operator/controllers/mcpoidcconfig_controller.gofindReferencingWorkloads,mapMCPRemoteProxyToOIDCConfigwatch handler, RBAC markercmd/thv-operator/controllers/mcpremoteproxy_runconfig.goresolveAndAddOIDCConfighelper supporting both MCPOIDCConfigRef and legacy inline pathscmd/thv-operator/controllers/mcpremoteproxy_deployment.goOIDCConfig, extractedbuildOIDCClientSecretEnvVarshelpercmd/thv-operator/api/v1alpha1/zz_generated.deepcopy.goOIDCConfigfielddeploy/charts/operator-crds/docs/operator/crd-api.mdcmd/thv-operator/test-integration/mcp-oidc-config/mcpoidcconfig_mcpremoteproxy_integration_test.gocmd/thv-operator/test-integration/mcp-oidc-config/suite_test.go*_test.gofilesOIDCConfigfieldDoes this introduce a user-facing change?
MCPRemoteProxy resources can now reference a shared
MCPOIDCConfigviaspec.oidcConfigRefinstead of only using inlinespec.oidcConfig. TheoidcConfigfield is now optional and deprecated — existing manifests continue to work but should migrate tooidcConfigRef. The two fields are mutually exclusive (enforced by CEL validation).Special notes for reviewers
mcpserver_types.go(no per-type duplicates)GetOIDCConfigForServerhelper is reused despite its MCPServer-flavored name — it works for any workloadGenerated with Claude Code