Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalizers allow a reconciler to clean up state for a resource that has been deleted by a client, and not yet fully removed. Resources with finalizers will stay in this terminating state until all finalizers are cleared from the resource. ParentReconcilers will now reconcile resources that are terminating as long as they also have a pending finalizer. SyncReconcilers have a new, optional, Finalize method that is called when the resource is terminating. The Sync method will not be called unless SyncDuringFinalization is true. Users are responsible to add and clear finalizers from resources. The AddParentFinalizer and ClearParentFinalizer functions will patch the resource. These method work with cast parents objects and use the same client the ParentReconciler used to originally load the parent resource, so they can be called inside SubReconcilers that use a different client. ChildReconcilers have a Finalizer field that when set will ensure that value is set on the parent resource finalizers before creating/updating a child resource. It will also clear that finalizer after the child is deleted. When the parent is terminating, the DesiredChild method is not called and existing children are deleted. Signed-off-by: Scott Andrews <andrewssc@vmware.com>
- Loading branch information
Showing
7 changed files
with
771 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.