Collect K8S events and pod configuration on K8S based tests #1637
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.
Description
#1606 added some basic K8S based tests. Because the amount of changes needed for those to work were significant, I decided to postpone adding anything that was not absolutely necessary for the tests to work. Now that those have been merged to master, it's a great time to improve them a bit and make them easier to work with.
This PR makes it so alongside the collector logs for the tests, the events for the involved namespaces and the pod configuration used by pods are also dumped in order to provide more details when a deeper issue arises and no logs are available. The one "downside" to the approach is the dumped events and configuration are in JSON format, since that seemed like the easiest to get working, using
jq
and/orgrep
should make it relatively easy to get any required information, a couple example queries forjq
have been added to the tests docs as examples.Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
Ran the tests manually and checked the new logs are created.