Route OIDCConfigHash through StatusManager in VirtualMCPServer - #4539
Conversation
handleOIDCConfig wrote OIDCConfigHash directly via r.Status().Update() while every other status field used the batched StatusManager. This mixed-write pattern could produce spurious 409 Conflict errors when the original vmcp object's resourceVersion became stale after earlier applyStatusUpdates calls in the same reconciliation. Add SetOIDCConfigHash to the StatusManager interface and route both the set and clear paths through it, eliminating all direct VirtualMCPServer status writes from handleOIDCConfig. Fixes #4504 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude Please review this PR with the agents. Only mention critical/high issues and non controversial medium issues. ignore issues around style and preference. give an approve or reject conclusion |
|
Claude finished @ChrisJBurns's task in 2m 44s —— View job PR Review: Route OIDCConfigHash through StatusManager
SummaryThe change is correct and safe. It eliminates the mixed-write pattern in Issues FoundMedium — Pre-existing:
Medium — Pre-existing: Hash comparison reads stale
Both issues are candidates for a follow-up cleanup (resetting Conclusion: ApproveThe PR correctly fixes the stated bug. The new |
Agent Review of FindingsThree specialist agents (Kubernetes operator expert, Go code writer, code reviewer) independently traced the full reconcile flow to evaluate the two medium findings. All three reached the same conclusion: both are non-issues that require no follow-up. Finding 1:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4539 +/- ##
==========================================
+ Coverage 68.86% 68.93% +0.07%
==========================================
Files 505 505
Lines 52320 52380 +60
==========================================
+ Hits 36028 36110 +82
+ Misses 13504 13481 -23
- Partials 2788 2789 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
handleOIDCConfigwroteOIDCConfigHashdirectly viar.Status().Update(ctx, vmcp)while every other VirtualMCPServer status field used the batchedStatusManager. This mixed-write pattern could produce spurious 409 Conflict errors when the originalvmcpobject'sresourceVersionbecame stale after earlierapplyStatusUpdatescalls in the same reconciliation.Adds
SetOIDCConfigHashto theStatusManagerinterface and routes both the set and clear paths through it, eliminating all direct VirtualMCPServer status writes fromhandleOIDCConfig.Fixes #4504
Type of change
Changes
types.goSetOIDCConfigHash(hash string)toStatusManagerinterfacecollector.gooidcConfigHash *stringfield, setter,UpdateStatusapplication logic, debug logvirtualmcpserver_controller.gor.Status().Update()calls withstatusManager.SetOIDCConfigHash(...)collector_test.gomocks/mock_collector.gogo generateTest plan
task test) — all pass, including 2 new collector teststask lint) — 0 issueshandleOIDCConfig)Special notes for reviewers
r.Status().Update(ctx, oidcConfig)inupdateOIDCConfigReferencingWorkloadsis intentionally unchanged — it writes to the MCPOIDCConfig resource (different resource), not VirtualMCPServer.SetURL/SetMessagesemantics). The*stringpointer in the collector distinguishes "never called" from "called with empty string".handleOIDCConfigmakes zero direct VirtualMCPServer status writes on any path.Generated with Claude Code