feat: status subresource with MAIN, conditions, printer columns#25
Open
as51340 wants to merge 1 commit into
Open
feat: status subresource with MAIN, conditions, printer columns#25as51340 wants to merge 1 commit into
as51340 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Implements
specs/operator-mvp/issues/06-status-and-conditions.md: makes cluster health inspectable from the CR without hand-querying coordinators. Status is observation-only — no secret material, never read back as reconcile input.Changes
API (
api/v1alpha1)status.main: the data instance currently observed as MAIN (empty before initial election; updates on coordinator-driven failover).Ready— a MAIN is elected and the leader is reachable (is the cluster serving?).Converged— the observed cluster matches the declared topology (no pending registration commands).Readybut notConverged— a MAIN keeps serving while a lost replica registration is restored.kubectl get mgc: Coordinators, Data, Main, Ready, Converged, Age.Controller (
internal/controller)SHOW INSTANCESand setting conditions per phase (bootstrapping → converged → degraded).writeStatusskips no-op patches, so a converged cluster re-observed on every resync does not churn the resource version.State → conditions
WorkloadsNotReady)WorkloadsNotReady)CoordinatorUnreachable)CoordinatorUnreachable)NoMainElected)RegistrationInProgress)MainElected)RegistrationInProgress)MainElected)AllInstancesRegistered)Tests
New envtest coverage (HA client mocked): bootstrapping, unreachable/degraded, converged, drift (Ready stays True while Converged drops), MAIN tracked across a coordinator-driven failover with no operator promotion, and a spec-immutability-under-status-update check. Added a connect-failure toggle to the fake cluster.
make testandmake lintgreen.Base branch:
01-repo-reset-scaffold. Scoped strictly to issue 06.