Files
cozystack/hack
Myasnikov DaniilandClaude Opus 4.8 bfaac1ef12 test(e2e): enrich host crust-gather snapshot with helm + collect logs
cozytest.sh's parent-shell EXIT trap snapshots the HOST cluster on a failed
test (nested tenant clusters are captured separately, by run-kubernetes.sh's
in-subshell trap, while their port-forward is still alive). That host
snapshot had three gaps: the collect's output went to /dev/null so a failed
collect left no clue why; Helm release storage (kind Secret) was dropped
along with every other Secret, losing the revision history that explains a
HelmRelease stuck mid-install; and the node host-log scanner burned the
collect's --duration deadline on debug pods PodSecurity can never admit,
forcing a non-zero exit even though the API tree was already on disk.

- factor the collect into a _cozy_collect helper that captures
  stdout/stderr/rc to a sibling .collect.log and prints a per-target status,
  so a failed collect leaves evidence in the artifact instead of vanishing;
  bound it with `timeout -k 30 5m` so a degraded cluster can't stall the job
- classify a non-zero collect that still wrote a resource tree as PARTIAL
  rather than FAILED, so a usable snapshot isn't discarded over the label
  (capture $? as the first statement in the else — after `fi` it would be
  the if-compound's 0, not the collect's exit code)
- add a dedicated include-only collect (_cozy_collect_helm) for Helm release
  secrets (sh.helm.release.*), so the artifact carries each release's
  revision history and status
- pass --disable-additional-logs so the host-log scanner doesn't burn the
  deadline on debug pods that can never be admitted; container/pod logs come
  from a separate path and are unaffected, and Talos host logs aren't
  reachable that way anyway

crust-gather puts all CLI filters in one FilterList evaluated with .all(),
so `--include-kind Secret --include-name <re>` keeps a Secret only when both
match — verified from source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-06-30 12:06:49 +05:00
..
2026-02-17 22:54:12 +01:00