Summary
In VirtualMCPServerReconciler.handleOIDCConfig, the OIDCConfigHash field is written directly via r.Status().Update(ctx, vmcp), while all other status fields in the VirtualMCPServer reconciler are buffered through the statusManager and flushed in a single batched applyStatusUpdates call.
This creates a mixed-write pattern: the direct update succeeds with one ResourceVersion, then the batched flush re-fetches and writes again. In practice this works because applyStatusUpdates re-fetches before writing, but a version conflict between the two writes would cause the hash update to be lost (recovered on requeue, but adds an unnecessary round-trip).
Ref: #4493 (comment)
Current behavior
// In handleOIDCConfig — direct write
vmcp.Status.OIDCConfigHash = oidcConfig.Status.ConfigHash
if err := r.Status().Update(ctx, vmcp); err != nil {
return fmt.Errorf("failed to update MCPOIDCConfig hash in status: %w", err)
}
Desired behavior
Track OIDCConfigHash through the StatusManager like all other status fields. This requires adding a SetOIDCConfigHash(hash string) method to the StatusManager interface and its implementation in the StatusCollector.
Context
The MCPServer controller uses the same direct-update pattern for OIDCConfigHash, but MCPServer doesn't use a statusManager — it writes status directly throughout. The inconsistency is specific to VirtualMCPServer which adopted statusManager for batched updates.
Summary
In
VirtualMCPServerReconciler.handleOIDCConfig, theOIDCConfigHashfield is written directly viar.Status().Update(ctx, vmcp), while all other status fields in the VirtualMCPServer reconciler are buffered through thestatusManagerand flushed in a single batchedapplyStatusUpdatescall.This creates a mixed-write pattern: the direct update succeeds with one ResourceVersion, then the batched flush re-fetches and writes again. In practice this works because
applyStatusUpdatesre-fetches before writing, but a version conflict between the two writes would cause the hash update to be lost (recovered on requeue, but adds an unnecessary round-trip).Ref: #4493 (comment)
Current behavior
Desired behavior
Track
OIDCConfigHashthrough theStatusManagerlike all other status fields. This requires adding aSetOIDCConfigHash(hash string)method to theStatusManagerinterface and its implementation in theStatusCollector.Context
The MCPServer controller uses the same direct-update pattern for
OIDCConfigHash, but MCPServer doesn't use astatusManager— it writes status directly throughout. The inconsistency is specific to VirtualMCPServer which adoptedstatusManagerfor batched updates.