pub trait FinalizerCleanup:
Resource
+ ResourceExt
+ Clone {
// Required method
fn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for resources that require cleanup operations when being deleted.
Implement this trait to define custom cleanup logic that should run before a finalizer is removed from a resource.
Required Methods§
Sourcefn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cleanup<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Perform cleanup operations before the finalizer is removed.
This method is called when a resource with a deletion timestamp still has the finalizer present. Implement any cleanup logic needed before the resource is fully deleted.
§Arguments
client- Kubernetes client for accessing the API
§Returns
Returns Ok(()) if cleanup succeeded, or an error if cleanup failed.
If this method returns an error, the finalizer will NOT be removed and
deletion will be blocked until cleanup succeeds.
§Errors
Should return an error if:
- Child resources cannot be deleted
- External systems cannot be cleaned up
- Any other cleanup operation fails
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl FinalizerCleanup for Bind9Cluster
Implement cleanup trait for Bind9Cluster finalizer management
impl FinalizerCleanup for Bind9Instance
Implement cleanup trait for Bind9Instance finalizer management
impl FinalizerCleanup for ClusterBind9Provider
Implement finalizer cleanup for ClusterBind9Provider.
This handles deletion of all managed Bind9Cluster resources when the
global cluster is deleted.