PT-2219 - Collect PXC files from pxc container when logs sidecar is disabled - #1143
Open
eslavyansky wants to merge 2 commits into
Open
PT-2219 - Collect PXC files from pxc container when logs sidecar is disabled#1143eslavyansky wants to merge 2 commits into
eslavyansky wants to merge 2 commits into
Conversation
…isabled pt-k8s-debug-collector collected the PXC var/lib/mysql files only from the "logs" sidecar container. When the log collector is disabled (or absent), that container does not exist and the files were silently skipped. Make container selection fall back through an ordered list of candidates: for PXC try "logs" first, then "pxc". Add selectContainer() returning the first candidate present in the pod, and use it in getIndividualFiles.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates pt-k8s-debug-collector to ensure PXC /var/lib/mysql-related files are still collected even when the logs sidecar container is disabled or absent, by allowing file collection to target multiple candidate containers and selecting the first one present in the Pod spec.
Changes:
- Extend
individualFileto support multiple candidate container names (containerNames) instead of a singlecontainerName. - Add container selection logic so PXC file collection can fall back from
logstopxcwhen needed. - Minor formatting cleanup in
New().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/go/pt-k8s-debug-collector/dumper/resources.go |
Updates per-resource definitions to use containerNames, and makes PXC search logs then pxc. |
src/go/pt-k8s-debug-collector/dumper/individual_files.go |
Introduces selectContainer() and updates collection flow to use the selected container. |
src/go/pt-k8s-debug-collector/dumper/dumper.go |
Updates individualFile struct to replace containerName with containerNames; minor formatting tweak. |
💡 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pt-k8s-debug-collector previously gathered PXC /var/lib/mysql files only from the logs sidecar container. When the log collector was disabled or missing, that container wasn’t present, so the files were quietly omitted.