Skip to content

[eno][tombstone-recovery 6/7] Clean up inventory Secrets on Composition deletion - #664

Merged
Ruinan Liu (ruinan-liu) merged 3 commits into
mainfrom
users/ruinanliu/backup-6-inventory-deletion
Oct 21, 2026
Merged

Ruinan Liu (ruinan-liu) merged 3 commits into
mainfrom
users/ruinanliu/backup-6-inventory-deletion

Conversation

@ruinan-liu

Copy link
Copy Markdown
Collaborator

Summary

Delete a Composition's inventory Secrets from the downstream cluster's kube-system namespace when the Composition is deleted while its Symphony is not being deleted.

Behavior

  • Add cleanupInventory as a tombstone recovery operation selected by selectTombstoneRecoveryOperation.
  • Run cleanup when the operator is enabled, the Composition is in scope and opted in (eno.azure.io/recovery-enabled: "true"), and it has a DeletionTimestamp.
  • List Secrets by the Composition's eno.azure.io/inventory-lineage label and delete all of them, across every synthesis UUID and chunk. NotFound counts as deleted.
  • Start as soon as deletion starts; do not wait for dependents, downstream resource deletion, or CurrentSynthesis.Reconciled.
  • Retry list and delete errors through the controller's normal backoff while the Composition still exists.

Safety

  • Keep inventory when the Composition has eno.azure.io/symphony-deleting: "true"; Symphony deletion orphans downstream resources.
  • Delete only Secrets with this Composition's lineage label in downstream kube-system.
  • No finalizer, no Composition status writes, and no downstream resource deletion.
  • Deleting Compositions still bypass recovery and inventory recording.

Limitations and Scope

  • Best effort: if the Composition disappears before cleanup succeeds, its inventory Secrets remain.
  • General garbage collection of inventory for Compositions that are already gone remains separate work

@ruinan-liu
Ruinan Liu (ruinan-liu) force-pushed the users/ruinanliu/ruinanliu/backup-5-inventory-record branch from cf3920f to 214fa64 Compare October 13, 2026 20:07
@ruinan-liu
Ruinan Liu (ruinan-liu) force-pushed the users/ruinanliu/backup-6-inventory-deletion branch from 4ad869a to a753aed Compare October 13, 2026 20:16
@ruinan-liu
Ruinan Liu (ruinan-liu) changed the base branch from users/ruinanliu/ruinanliu/backup-5-inventory-record to main October 16, 2026 05:15
Comment thread internal/controllers/tombstonerecovery/controller.go Outdated

@ruinan-liu Ruinan Liu (ruinan-liu) left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Respond to comment

@ruinan-liu
Ruinan Liu (ruinan-liu) merged commit 27d480e into main Oct 21, 2026
71 checks passed
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.

2 participants