Skip to content

Status condition not persisted when OIDCConfigHash unchanged after transient error #4511

@ChrisJBurns

Description

@ChrisJBurns

Summary

In all three workload controllers (MCPServer, VirtualMCPServer, MCPRemoteProxy), handleOIDCConfig sets the OIDCConfigRefValidated condition to True in memory after validation passes, but only calls r.Status().Update() inside the if hash changed block. If the condition was previously False (e.g., after a transient error where the MCPOIDCConfig was temporarily unavailable) and is now True, but the config hash hasn't changed, the condition update is never persisted.

Scenario

  1. MCPOIDCConfig exists and is valid → hash stored, condition=True
  2. MCPOIDCConfig temporarily deleted → condition set to False, phase=Failed
  3. MCPOIDCConfig re-created with same content (same hash) → condition set to True in memory but Status().Update() skipped because hash is unchanged

The condition eventually self-heals on the next reconcile that changes hash or on a full resync, but there's a window where the status is stale.

Affected controllers

  • MCPServerReconciler.handleOIDCConfig (mcpserver_controller.go)
  • VirtualMCPServerReconciler.handleOIDCConfig (virtualmcpserver_controller.go)
  • MCPRemoteProxyReconciler.handleOIDCConfig (mcpremoteproxy_controller.go)

Proposed fix

After setting the valid condition and checking the hash, add an unconditional status update if the condition changed (similar to how MCPOIDCConfigReconciler.Reconcile handles conditionChanged). Alternatively, always persist status when the condition transitions from False→True regardless of hash state.

Severity

Low — the condition self-heals on the next reconcile cycle that triggers a status write. No functional impact on workload deployment since the reconcile loop continues past this point.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions