PT-2421 - Adding further data collection to pt-k8s-debug-collector#1141
PT-2421 - Adding further data collection to pt-k8s-debug-collector#1141eslavyansky wants to merge 4 commits into
Conversation
This PR introduces additional files in to the final dump archive for pgv2. Tool logs: - patronictl list - pgbackrest info Log files from folders: - $PGDATA/log - pgdata/pgbackrest/log
6acedd9 to
c290de3
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends pt-k8s-debug-collector’s PG v2 (“pgv2”) collection to include additional pgBackRest logs and command outputs in the generated dump archive, and updates the integration test suite to validate those artifacts are present.
Changes:
- Add collection of
pgdata/pgbackrest/loginto the dump archive forpgv2. - Add “tool log” collection for
pgv2by executingpatronictl listandpgbackrest infoin the database container and archiving the outputs as files. - Extend
TestIndividualFilescoverage to assert the newpgv2log files are present incluster-dump.tar.gz.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/go/pt-k8s-debug-collector/main_test.go | Adds pgv2 assertions for pgBackRest log files and tool-output log files in the archive. |
| src/go/pt-k8s-debug-collector/dumper/resources.go | Registers new pgv2 directory dump (pgbackrest_log) and tool commands to run. |
| src/go/pt-k8s-debug-collector/dumper/individual_files.go | Implements execution + archiving of tool outputs via processToolOutput. |
| src/go/pt-k8s-debug-collector/dumper/dumper.go | Introduces the toolLog type and adds toolCmds to individualFile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Two issues with this PR:
Actually, tool exhibits correct behavior, because if resource none is specified, only K8 resourses should be collected, not database-specific. I noticed you implemented it for pgv2 only. This maybe OK, because we need to deprecate pgo, but user manual should also mention it. |
svetasmirnova
left a comment
There was a problem hiding this comment.
See my previous comment.
With --resource none only general Kubernetes data is collected, not database-specific files, so TestIndividualFiles must not expect them. Add a skipForNone flag and skip those checks when the resource is none, while keeping the pod container log check (collected for every resource). Drop the now-redundant tar-error guard so genuine failures are not masked.
List the individual files and tool command outputs that are collected for PostgreSQL Operator v2 (pgv2).
|
@svetasmirnova check please |
This PR introduces additional files in to the final dump archive for pgv2.
Tool logs:
Log files from folders:
$PGDATA/log
pgdata/pgbackrest/log
The contributed code is licensed under GPL v2.0
Contributor Licence Agreement (CLA) is signed
util/update-modules has been ran
Documentation updated
Test suite update