sync: support configurable deletion propagation#180
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @sudo-amine. Thanks for your PR. I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
1ef81f1 to
86b6229
Compare
Use an annotation on kcp source objects to select the propagation policy for deleting service-cluster copies. Keep background propagation as the default and resolve kcp-origin related resources from their own annotations. Signed-off-by: Amine HADRI <amine.hadri.mba@gmail.com>
86b6229 to
27965d3
Compare
Summary
The Sync Agent currently uses background propagation when deleting synchronized
objects from the service cluster. Consequently, foreground and orphan
deletion policies cannot be reflected from kcp side to individual service-cluster copies.
The propagation policy from a kcp DELETE request is not persisted as object
state that the Sync Agent can reliably consume. This change therefore reads the
syncagent.kcp.io/deletion-propagation-policyannotation from the kcp sourceobject and applies the selected policy when deleting the service-cluster copy.
Supported values are
background,foreground, andorphan. Missing orunsupported values preserve the existing background behavior. The annotation
is not copied to the service-cluster object.
Kcp-origin related resources resolve the policy from their own source object.
Service-origin related resources retain their existing behavior.
Design rationale
Several alternatives were considered:
DeleteOptions.PropagationPolicyvalue is not persisted on the object, andgarbage-collection finalizers are not a durable signal for every policy.
deletion, but it would require changes in the generic kcp storage deletion
path to capture and persist the DELETE option. This would couple low-level
kcp storage behavior to a Sync Agent-specific protocol, while also requiring
finalizer rollout and lifecycle management on existing objects.
permissions, deployment lifecycle, and ownership concerns, especially when
several agents share the same API source.
PublishedResourcewould introduce an API change while still beingpoorly suited to a policy selected for an individual object.
The annotation approach is intentionally narrow and explicit. It stores the
policy on the source object where it remains observable until cleanup, requires
no API, storage, or admission changes, and does not modify the existing
finalizer lifecycle.
What Type of PR Is This?
/kind feature
Related Issue(s)
Addresses #174
Validation
make importsmake testTestPrimaryDeletionPropagationPolicyTestKcpRelatedCleanupUsesItsOwnDeletionPropagationPolicyRelease Notes