New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MedusaTask to delete only its own backups #1025
Conversation
211e408
to
b38f32d
Compare
Codecov Report
@@ Coverage Diff @@
## main #1025 +/- ##
==========================================
- Coverage 57.49% 57.48% -0.01%
==========================================
Files 99 99
Lines 10011 10011
==========================================
- Hits 5756 5755 -1
Misses 3764 3764
- Partials 491 492 +1
|
Hey, thanks for the PR. What I'd really like to see on this one is a test, to ensure that the functionality actually does fix the issue (so a test which would fail without the fix and passes with the fix in place). e2e test isn't necessary, unit / integration test (envtest) is perfectly fine. The issue in reality comes from the fact that the Pod's fetched backups do not match the localBackup search. Even with just comparing Datacenters we're really comparing the Task's Datacenter vs. whatever the Pod believes is the correct Datacenter. This is not necessarily the same thing, due to the ability to override the Datacenter. In that case, the task will have a Datacenter name that's not recognized by the Pod's Datacenter. @adejanovski I think the above issue plagues any user who uses DatacenterName overrides in cass-operator. Doesn't the Pod backup store the Cassandra's real Datacenter name instead of the CassandraDatacenter.Name? If so, we need to fetch the original CassandraDatacenter and use its |
Alright, the Datacenter name is fine. So the only thing to add would be the tests that verify the correct behavior. |
5ad0143
to
209868f
Compare
Hello, @burmanm! I've implemented an integration test for the following scenarios:
The final condition will pass the test only if we verify that If you have the time, please take a look at the PR and let me know your thoughts. Your feedback is much appreciated, and if there's anything that needs further rephrasing or improvement, feel free to point it out. Thank you for your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need a rebase for the changelog file.
209868f
to
70821b1
Compare
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Done |
Thank you for the PR. |
What this PR does: This commit addresses the issue where MedusaTask was erroneously deleting medusabackups belonging to other cassandraDatacenters in the same namespace. The bug occurred due to the lack of a condition to check if the
backup.Spec.CassandraDatacenter
matched thetask.Spec.CassandraDatacenter
. This fix adds the necessary condition to ensure that MedusaTask only deletes its own Cassandra backups, resolving the issue reported in the PR.Which issue(s) this PR fixes:
Fixes #1017
Checklist