Skip to content

PT-2219 - Collect PXC files from pxc container when logs sidecar is disabled - #1143

Open
eslavyansky wants to merge 2 commits into
percona:3.xfrom
eslavyansky:PT-2219-pxc-container-fallback
Open

PT-2219 - Collect PXC files from pxc container when logs sidecar is disabled#1143
eslavyansky wants to merge 2 commits into
percona:3.xfrom
eslavyansky:PT-2219-pxc-container-fallback

Conversation

@eslavyansky

Copy link
Copy Markdown
Contributor

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.

  • 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

…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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 individualFile to support multiple candidate container names (containerNames) instead of a single containerName.
  • Add container selection logic so PXC file collection can fall back from logs to pxc when 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.

Comment thread src/go/pt-k8s-debug-collector/dumper/individual_files.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@eslavyansky eslavyansky left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants