Finalize

A specialized combination of Pepr’s Mutate & Watch functionalities that allow a module author to run logic while Kubernetes is Finalizing a resource (i.e. cleaning up related resources after a deleteion request has been accepted).

This method will:

  1. Inject a finalizer into the metadata.finalizers field of the requested resource during the mutation phase of the admission.

  2. Watch appropriate resource lifecycle events & invoke the given callback.

  3. Remove the injected finalizer from the metadata.finalizers field of the requested resource.