Repository navigation
Description
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:
- 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.
- 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: 2Printer columns should match MCPServer:
STATUS | READY | REPLICAS | URL | AGE
Migration and Compatibility
- CRD version: This is
v1alpha1which 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.
Stoppedphase: Intentionally omitted. MCPServer hasStoppedfor scale-to-zero, but MCPRegistry has noreplicasspec field. AddStoppedonly if/when MCPRegistry gains explicit replica control.
Documentation
cmd/thv-operator/DESIGN.mdsections on StatusCollector pattern and sync operation design need updating to reflect the simplified status model.
Acceptance Criteria
SyncStatusstruct,SyncPhasetype, and all sync-related status fields removedAPIStatusstruct,APIPhasetype, and all API-related status fields removedMCPRegistryPhasesimplified to matchMCPServerPhase(Pending/Running/Failed/Terminating)DeriveOverallPhase()removed — phase set directly by controllerDefaultStatusDeriverand related complexity inmcpregistrystatuspackage removed or simplified- Registry-specific condition types (
ConditionSyncSuccessful,ConditionAPIReady) replaced with standardReadycondition MCPRegistryStatuscontains: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 gensucceeds,task testpasses
Sub-Issues
- Refactor MCPRegistry Status Types #4269 — Refactor MCPRegistry Status Types (types, enums, structs)
- Update MCPRegistry Controller for Standard Workload Status #4270 — Update MCPRegistry Controller for Standard Workload Status
- Update image validation for MCPRegistry phase rename #4510 — Update image validation for MCPRegistry phase rename
Activity
Consolidate MCPRegistry status to match MCPServer pattern
Consolidate MCPRegistry status to match MCPServer pattern (#4643)