Commit Graph
2 Commits
Author SHA1 Message Date
Myasnikov DaniilandClaude Opus 4.7 b40ab290eb fix(cozyreport): portability and Ready-filter fixes from review
- Resolve hack/cozyreport-summary.sh via SCRIPT_DIR so cozyreport.sh
  can be invoked from any working directory, not only the repo root.
- Discover Talos node IPs via `kubectl get nodes` (with the existing
  192.168.123.11-13 list as fallback) instead of hardcoding the E2E
  sandbox topology.
- Replace broken `awk '$NF != "True"'` filter on the cozystack-apps
  loop with a jsonpath check against the Ready condition; the previous
  filter compared AGE ("10m" etc.) against "True" and let every
  resource through, defeating the non-Ready filter.
- Switch the Flux source CRD summary loop from column parsing to
  jsonpath (column positions differ between HelmRepository and
  OCIRepository printer columns) and add ExternalArtifact, matching
  what cozyreport.sh already collects.
- Add `kubectl get crd` guards before HR/source CRD queries so the
  summary script does not abort under `set -eu` when Flux v2 is not
  installed.
- Relabel "OOMKilled in last 30 min" to "Recent OOMKilled events
  (last 20)" — the kubectl call only limits count, not time.

Surfaced from coderabbit and gemini review on #2553.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-05-04 11:17:35 +05:00
Myasnikov Daniil aa72a232e6 feat(cozyreport): collect Flux/cert-manager/host context + summary.txt
`hack/cozyreport.sh` now collects materially more signal so a triage
artifact can show what is broken rather than just dumping pod logs:

- Flux controller logs (helm-controller, source-controller,
  notification-controller, kustomize-controller, last 2000 lines)
- Flux source resources (HelmRepository, OCIRepository, GitRepository,
  ExternalArtifact)
- Decoded Helm storage secrets for non-Ready HRs
  (`base64 -d | base64 -d | gzip -d`)
- Cluster events (all + warning-only filter)
- cert-manager Certificate / CertificateRequest / Order / Challenge
  resources + cert-manager logs
- `cozystack-operator` deployment logs (current + previous)
- `Application` / `ApplicationDefinition` / `Tenant` resources
- Sandbox host context per node: df, free, ps, dmesg,
  talosctl logs/dmesg/kubelet/containerd

New `hack/cozyreport-summary.sh` writes a `summary.txt` at the archive
root listing what is broken right now — first thing to read when
triaging an artifact.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Assisted-By: Claude <noreply@anthropic.com>
2026-05-02 17:55:40 +05:00