fix: sync KRM function resource deletions in specializers#1094
fix: sync KRM function resource deletions in specializers#1094pulkitvats2007-crypto wants to merge 1 commit into
Conversation
Signed-off-by: pulkitvats2007-crypto <pulkitvats2007@gmail.com>
|
[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 @pulkitvats2007-crypto. Thanks for your PR. I'm waiting for a nephio-project 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/test-infra repository. |
Summary
Fixes a critical issue where KRM function pipelines were unable to delete resources due to append-only reconciliation logic in the Specializer controllers.
Previously, controllers (
generic-specializer,ipam-specializer,vlan-specializer) rebuiltprr.Spec.Resourcesby iterating only overrl.Items. Since deleted resources are absent fromrl.Items, they were never removed from the map, resulting in stale ("ghost") resources persisting in the package.This PR introduces explicit deletion synchronization:
delete().This ensures full state reconciliation (create/update/delete) instead of append-only behavior.
Bug
Root Cause:
The controller assumed that iterating over the mutated
rl.Itemswas sufficient to sync state back toprr.Spec.Resources. This ignored deletion semantics entirely.Resulting Issue:
condkptsdkGC) were silently retained.Fix
originalPaths,survivingPaths)syncDeletedResourceshelper to reconcile deletionsgeneric-specializeripam-specializervlan-specializerImpact