When a gather runs
On a changed plan, and on retry until it succeeds. The plan is hashed into the
Job’s name, so an unchanged mapping finds the Job it already ran and skips the
stage. To force one, change the custos.helmetica.io/refresh annotation to any
new value; it is hashed in too. Nothing runs a gather on a timer, so a rotated
source password goes unnoticed until something pokes the credential config.
A failed gather reports the message its Job left in a ConfigMap rather than its
log, which is what keeps custos off pods/log, a cluster-wide grant over
output that routinely contains secrets.
Once the credential config is Ready its gather Job is deleted, since a settled gather
is read back from the gathered Secret and never from the Job. A Job that failed
is kept: its pods are the only place left to look, and the retry measures its
backoff from the Job’s own condition.
When a gather fails
The usual reason is that the service is not up yet, which a helm install that applies everything at once produces every time. That is a wait, not a fault, so custos retries at two levels and neither gives up.
The Job retries itself six times over about ten minutes of backoff, plus the
wait each attempt spends looking for a ready pod. While it still has attempts
left the credential config holds at Pending with the reason on it, for example
no ready pod matches app=postgres.
Once the Job gives up the credential config goes Failed, still carrying the reason, and
custos deletes the Job five minutes later so the next pass creates it again.
Failed is therefore not terminal: a credential config recovers on its own once the
thing it was waiting for turns up. Only a validation error is permanent, and
those never create a Job at all.