Controllers: shared reconcile base, Ready=False on returned errors, parent watches #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Remaining consistency items from the Oct 2026 review (three controllers now, so this is smaller than it was):
setNotReadyexists once per controller (setNotReady,setTeamNotReady,setNotReadyin the alert source), plus the same Get/NotFound prologue, finalizer add, andif r.Recorder != nilguard. Extract a shared helper or a generic reconciler.(ctrl.Result{}, err)and leavesReadyat its previous value, so a CR can look healthy while it is failing (HTTP errors, Secret read/write). One wrapper should setReady=Falsewith anErrorreason on any returned error.databaseError,teamError,childErrordo the same job: unify.TerdutAlertSourcestill polls its team every 15s (WaitingForTeam);TerdutTeamalready watches itsTerdutServer. Add a mapper watch onTerdutTeam.Adoptedon all three kinds, though nothing is adopted any more: rename toReconciled.status.observedGenerationis written but read only by tests; setObservedGenerationon eachmetav1.Conditioninstead and drop the field.ReasonTeamAdopted/ReasonChildAdopted/ReasonAdoptedcollapse into one.