sync: support configurable deletion propagation - #180
Conversation
|
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. |
86b6229 to
27965d3
Compare
|
/ok-to-test |
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>
27965d3 to
a42b8b7
Compare
golangci-lint's predeclared linter flags local variables named copy since it shadows the builtin. Rename to copyObj to fix the lint job. Signed-off-by: Amine HADRI <amine.hadri.mba@gmail.com>
1609776 to
dc31167
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM label has been added. DetailsGit tree hash: d1d2155f6dbe435ffc93167c234f9202e9a163d1 |
Summary
Today the Sync Agent always deletes a service-cluster copy with
backgroundpropagation when its kcp source object is deleted. There is no way for a user to requestforegroundororphandeletion for an individual object.This PR lets the kcp source object opt into a different policy via an annotation:
background,foreground,orphan.background(unchanged default behavior).For related resources, the policy is resolved per-object:
kcp-origin related resources read the policy from their own annotation, same as the primary object.service-origin related resources are unaffected and keep usingbackground.Design rationale
A few alternatives were considered and rejected:
DeleteOptions.PropagationPolicyon the object, so there is nothing durable for the Agent to read back later. A deterministic handshake would need changes to kcp's generic storage deletion path to capture and persist that option — coupling low-level kcp storage behavior to an Agent-specific protocol, plus finalizer rollout/lifecycle work on existing objects.PublishedResource. Would require an API change, andPublishedResourceapplies to every object of a kind — a poor fit for a policy that needs to vary per individual object.The annotation is intentionally narrow and explicit: it stores the policy on the source object where it stays observable until cleanup, requires no API/storage/admission changes, and leaves the existing finalizer lifecycle untouched.
What Type of PR Is This?
/kind feature
Related Issue(s)
Fixes #174
Release Notes