You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aa830e9
Browse filesBrowse the repository at this point in the historyBrowse files
feat: switch primary-status-unreachable signal from Phase to Event
The prior commit on this branch (f1204b22c) surfaced the /pg/status
unreachability guard as a new v1 Phase, PhaseWaitingForPrimaryStatus.
On reflection, Event is a better fit for this observation:
- The signal is transient (a reconcile-loop observation, not a
lifecycle state). Phase is single-slot and would flap between
Healthy and Waiting on each 10s requeue, polluting the one-line
`kubectl get cluster` view rather than informing it.
- Phase permanently extends the v1 API enum; Events do not.
- The Kubernetes event recorder natively deduplicates by
(involvedObject, reason, message), so a sustained outage rolls up
into one logical event with a growing count and moving
lastTimestamp.
This commit drops PhaseWaitingForPrimaryStatus and its RegisterPhase
call, and emits a Warning PrimaryStatusUnreachable event from
evaluatePodReadinessGuards in its place. The event message is kept
stable (no %v of the error) to preserve dedup; the underlying error
is logged at the guard site via contextLogger.Warning with an 'err'
structured field, and the event message points users there.
IsPodReadyAndNotReporting now returns (bool, error) so the guard's
log line can carry the instance manager's error without a second
iteration over the status list. The helper has a single caller, so
the signature change is zero blast radius.
The (ctrl.Result, error) signature of evaluatePodReadinessGuards
introduced in f1204b22c is reverted to a single ctrl.Result return:
without the RegisterPhase call, the function has no error source,
and golangci-lint's unparam rightly flags result 1 as always nil.
Deliberately out of scope (follow-ups):
- No max-duration escape when operator-to-primary networking is
persistently broken while the kubelet readiness probe keeps
passing. /readyz and /pg/status are served by different handlers
in the instance manager and can diverge.
- No new Prometheus metric for time since last successful /pg/status.
- No event emission on the kubelet-stale-readiness branch (expected
sub-second, event noise not worth the added signal).
Depends on #10445.
Signed-off-by: Armando Ruocco <[email protected]>
0 commit comments