Skip to content

MCPRegistry Status Consolidation #4251

Closed
3 of 3 issues completed
Closed

Description

@ChrisJBurns

As a cluster operator monitoring MCPRegistry health,
I want MCPRegistry status to follow the same pattern as MCPServer (standard Kubernetes workload status),
so that I can use standard Kubernetes tooling (e.g., kubectl wait --for=condition=Ready) and the CRD behaves consistently with other ToolHive workloads.

Size: M
Dependencies: None
Labels: operator, api

Context

MCPRegistry currently has three separate phase enums:

  • Status.Phase (MCPRegistryPhase: Pending/Ready/Failed/Syncing/Terminating)
  • Status.SyncStatus.Phase (SyncPhase: Syncing/Complete/Failed)
  • Status.APIStatus.Phase (APIPhase: NotStarted/Deploying/Ready/Unhealthy/Error)

A DeriveOverallPhase() method computes the top-level phase from the sub-phases. This is over-engineered — MCPServer already follows a simple, standard Kubernetes workload pattern with Phase + Ready condition + ReadyReplicas, and MCPRegistry should do the same.

Why not track sync/API status separately?

The original design tracked internal registry server states (sync progress, API readiness) as distinct status fields. This approach has two problems:

  1. Requires calls to the registry server — checking sync status or API health would require the operator to query the registry server itself, which with auth enabled is not feasible without coupling the operator to the server's auth mechanisms.
  2. Couples the operator to registry server internals — the operator should care about whether the workload (container/pod) is running and ready, not the internal application state of the registry server. Sync progress and API readiness are implementation details of the registry server, not the operator's concern.

Open for discussion: if there's a compelling use case for exposing internal registry state, we can revisit. The default position is to only care about the deployment status/readiness of the container as a standard Kubernetes workload.

Target State

MCPRegistry status should mirror MCPServer status:

status:
  phase: Running              # Pending/Running/Failed/Terminating
  message: "Registry is running"
  observedGeneration: 3
  conditions:
    - type: Ready
      status: "True"
      reason: DeploymentAvailable
  url: "https://registry.example.com"
  readyReplicas: 2

Printer columns should match MCPServer:

STATUS | READY | REPLICAS | URL | AGE

Migration and Compatibility

  • CRD version: This is v1alpha1 which carries no stability guarantee. Breaking changes are expected.
  • No conversion webhook needed: This is a single-version CRD with no hub/spoke.
  • Existing resources: Orphaned status fields (.status.syncStatus, .status.apiStatus) will remain in etcd after CRD upgrade but will not be returned by the API server. They will be overwritten on the next controller reconciliation.
  • Helm CRD chart version: Must be bumped since this is a breaking CRD schema change.
  • Stopped phase: Intentionally omitted. MCPServer has Stopped for scale-to-zero, but MCPRegistry has no replicas spec field. Add Stopped only if/when MCPRegistry gains explicit replica control.

Documentation

  • cmd/thv-operator/DESIGN.md sections on StatusCollector pattern and sync operation design need updating to reflect the simplified status model.

Acceptance Criteria

  • SyncStatus struct, SyncPhase type, and all sync-related status fields removed
  • APIStatus struct, APIPhase type, and all API-related status fields removed
  • MCPRegistryPhase simplified to match MCPServerPhase (Pending/Running/Failed/Terminating)
  • DeriveOverallPhase() removed — phase set directly by controller
  • DefaultStatusDeriver and related complexity in mcpregistrystatus package removed or simplified
  • Registry-specific condition types (ConditionSyncSuccessful, ConditionAPIReady) replaced with standard Ready condition
  • MCPRegistryStatus contains: Conditions, ObservedGeneration, Phase, Message, URL, ReadyReplicas
  • Printer columns updated to match MCPServer: Status, Ready, Replicas, URL, Age
  • Controller updated to set status the same way MCPServer controller does
  • Image validation updated for phase rename
  • Helm CRD chart version bumped
  • Unit tests updated for new status shape
  • task gen succeeds, task test passes

Sub-Issues

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    kubernetes
    size/M
    on Mar 19, 2026
  2. added
    api
    on Mar 19, 2026
  3. added a commit that references this issue on Apr 7, 2026
    7929c07
  4. added a commit that references this issue on Apr 8, 2026
    d68ea47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

apibreaking-changekubernetesoperatorsize/M

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions