Expand description
T2.5 — one condition, set by its type, carried at most once.
★ THE DEFECT. A controller that reports a condition by writing it every tick wakes itself: the write fires a watch event, the event re-ticks the controller, and the controller writes again. The scheduler did this to an unschedulable pod, about 19 times a second (38 ticks in 2 s, measured 2026-09-18). Two ways into that loop:
- proposing a condition the object already carries, and
- re-stamping
lastTransitionTimeon every write, so that each write differs from the last one even when nothing about the condition did.
★ THE SHAPE. upsert_condition is the whole rule, as a pure function of
the object read and the condition asserted:
- a condition of the same
type,status,reasonandmessageisConditionUpsert::Unchanged: there is nothing to write; - otherwise the condition is set in place, at the position the type already holds, or appended; every other condition is left as it was;
lastTransitionTimemoves only whenstatusdoes. A write that only rewords the message carries the recorded time forward, so “how long has this been False” keeps its answer. When there is no recorded time to carry,nowis the honest fallback (the rulecrate::node_lease::ready_conditionalready follows for a Node);- the result holds exactly one condition of the type: duplicates are collapsed into the first.
crate::status::upsert_condition_cas reads the object, applies this and
writes the result at the revision it read. This mirrors upstream’s
meta.SetStatusCondition (apimachinery pkg/api/meta/conditions.go).
Structs§
- Desired
Condition - One condition as the controller that owns its
typeasserts it.
Enums§
- Condition
Status - A condition’s
status: upstream’s closed set. - Condition
Upsert - What
upsert_conditionmakes of the conditions an object carries.
Functions§
- upsert_
condition - Set
desiredon the conditionsobjectcarries, by type.