Repository navigation
feat(models): add soft deletion to Kubernetes resources - #617
Conversation
Signed-off-by: Prayas-35 <prayaspal04@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
pontusringblom
left a comment
There was a problem hiding this comment.
This is a clean, well-scoped first step: the indexed DeletedAt field with json:"-" keeps tombstone metadata out of broker messages and snapshot output, and the new test covers the three behaviors that matter. One thing to confirm in the meshery-side follow-up is the re-created resource case: since SetID derives the ID deterministically, a deleted-then-recreated resource gets the same ID, so the tombstoned row could block a plain Create unless the upsert path handles it.
Please consider and reply to each comment in this review. For every suggestion, state how you've incorporated it or explain your reasoning for not doing so.
pontusringblom
left a comment
There was a problem hiding this comment.
Thanks for the quick replies, both points are addressed well. The deterministic-ID re-create case will be handled in the meshery-side follow-up with an unscoped query, restore, and a regression test, and the Postgres migration path gets covered through the AutoMigrateSystemTables check there. I verified the new test locally: go test ./pkg/model -run TestKubernetesResourceSoftDelete passes.
This is a clean, well-scoped first step. Please consider and respond to every feedback point in this review, showing how you incorporated it or explaining why you rejected it.
|
Thanks for your contribution to Meshery! 🎉
|
Description
Adds GORM soft-deletion support to
KubernetesResourceby introducing an indexedDeletedAtfield.The field uses
json:"-", ensuring that persistence metadata is not included in MeshSync broker messages or snapshot output.Related to meshery/meshery#6458.
This is the first part of the cross-repository implementation. After this change is merged and a new MeshSync version is published, the dependency and server deletion behavior will be updated in
meshery/meshery.Tests
The new model test verifies that:
Unscoped()queries retain access to tombstoned resources;Validation
go test ./pkg/model -run '^TestKubernetesResourceSoftDelete$' -count=1go test --short ./... -count=1make buildContributor Checklist
git commit -s.Summary by CodeRabbit