Skip to content

Delay deletion of external managed resource until all 3rd-party finalizers are removed #851

@bobh66

Description

@bobh66

What problem are you facing?

When a Managed Resource is marked for deletion the Managed Reconciler immediately calls the external.Delete() method to trigger deletion of the external managed resource. This makes it impossible to perform any "pre-delete" actions such as taking a database backup before the resource has been deleted.

A common pattern in kubernetes is for controllers that have an interest in a resource they don't manage to place a finalizer on the resource so that they can be notified when the resource is deleted and perform some processing before the resource is garbage collected. This works for native and "local" kubernetes resources that do not have external manifestations to consider as the important data is in the CR instance.

This pattern does not work for Crossplane MRs because the reconciler does not consider the existence of other finalizers before deleting the remote resource.

How could Crossplane help solve your problem?

Crossplane could allow a similar pattern by delaying the call to external.Delete() until there are no finalizers on the MR other than the one Crossplane uses. This would allow scenarios such as Operation Functions that want to perform some action prior to the external resource being deleted.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions