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
fix(validator): use NotFound, wait out the rollout window, fix a fall-through
Review findings on the first commit, all verified.
ErrCodeUnavailable was wrong. validators/applicability.go is the in-repo
authority on exactly this decision and its table reads 'clean read,
absent/empty | recipe DECLARES -> FAIL (NotFound)', reserving Unavailable for
transport failures. The read here succeeds and the answer is 'not deployed', so
filing it under Unavailable would bucket a product defect with apiserver
hiccups — and tell whoever triages the new failures to re-run rather than to fix
their deployment. Swapped to ErrCodeNotFound.
The guard also fired on states the code elsewhere treats as transient.
isTrainerInstalled is an existence probe, not a readiness probe: it reports
incomplete for a CRD that is present but not yet Established, or a controller
Deployment that has not appeared. Both are ordinary rollout states on the
bundle-deploy-validate path, so a validate started while the chart was still
landing would have reported a deployment that had not failed. The declared path
now polls, bounded by TrainerControllerReadyTimeout, before returning a verdict.
The failure discarded a diagnosis it had already computed. isTrainerInstalled
logs which specific object was missing and then returned a bare false; that
reason is now carried out on trainerInstall.Incomplete and named in the error,
so the failure is self-diagnosing rather than sending an operator to the logs.
Restructuring for the poll introduced a fall-through that ineffassign caught: a
successful declared wait set installed = true and then continued into the
install path, which would have reinstalled over a Trainer the recipe delivered.
Both paths now share awaitTrainerController and return. A table case pins it.
Also corrects the comments on the undeclared path, which claimed it always
installs an ephemeral fixture. It reuses a complete pre-existing installation
and installs only when none is present — a supported state #2297 preserves.
Tests are now table-driven over the decision, and assert the error code rather
than only that the message names the component. The not-declared-and-absent row
is deliberately excluded: it reaches installTrainer, which downloads a release
archive, so it belongs in an integration test.
Refs #2297
Signed-off-by: Yuan Chen <yuanchen97@gmail.com>
0 commit comments