Commit ba858e3
authored
Fix must-gather output for omc compatibility (#4965)
* produce omc-compatible output from must-gather
* Add changelog entry for must-gather omc compatibility fix
* Collect logs from all pods in controller-manager deployment
We need to loop over the pods (in case replicas > 1)
* Update binary path to /usr/bin/gather
* Change collection dir to /must-gather
* Fix stale binary path in README and flag description in config
* Collect logs for CR pods and consolidate must-gather e2e tests
processPodsByInstance was writing pod YAML but not collecting container
logs, so collector/TA/bridge pod logs were missing from must-gather
output. Now iterates all containers and calls getPodLogs for each.
Remove the stale must-gather check from the otlp-metrics-traces e2e
test — it used the old directory layout and is fully covered by the
dedicated must-gather test.
* Fix omc log path and add pod YAML to log directory
omc expects container logs at pods/<pod>/<container>/<container>/logs/
(container name repeated twice), not pods/<pod>/<container>/logs/.
Also, omc logs discovers pods from pods/<pod>/<pod>.yaml — write pod
YAML there so omc logs can find and display them.
* must-gather: replace naive pluralFor with static lookup table
The previous implementation appended "es"/"s" based on whether the Kind
string ended in "s". This produces wrong paths for kinds like NetworkPolicy
(→ "networkpolicys" instead of "networkpolicies"), which omc cannot find.
Replace it with an explicit map covering all Kinds the tool collects.
log.Fatalf on unknown kinds ensures omissions are caught immediately
rather than silently writing to a path omc cannot parse.
* Add omc validation to must-gather e2e test
Download omc binary and verify it can parse the gathered output:
get opentelemetrycollectors, get deployments, get pods, and logs.
* Fix omc log validation by setting project before log check
omc logs defaults to the 'default' project, so it couldn't find the
gather-collector pod in the chainsaw-must-gather namespace.1 parent acde6d6 commit ba858e3
12 files changed
Lines changed: 574 additions & 442 deletions
File tree
- .chloggen
- cmd/gather
- cluster
- config
- tests/e2e-openshift
- must-gather
- otlp-metrics-traces
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments