feat!: update to versioned exported trace format #157
Merged
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
This fixes a bug where if you track multiple resource types (Deployments and StatefulSets) for example, some of the objects get deleted on tracer startup, due to a mishandling of the
Restart
event.This necessitated some changes to the trace file to track GVKs in addition to namespaced names of objects in its "index". Since I was in the code, I also took the opportunity here to update the format of the trace file to make it more future-proof. Trace files now include a version parameter, and are a dictionary of objects instead of just a list. This way I can add new fields or elements to the trace, and if you're running an old version of simkube they will be silently ignored. However, this change in format is a BREAKING CHANGE, hence this will bump SimKube to 2.0.
Testing done
make test
; added a new test into the trace_store_test code that would catch the initial bug that triggered this change