How to delete a custom object and wait until it is cleaned up with propagation_policy
#2161
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
lifecycle/rotten
Denotes an issue or PR that has aged beyond stale and will be auto-closed.
What is the feature and why do you need it:
I'm trying to use Kubernetes python sdk to delete a CR with
custom_api.delete_namespaced_custom_object
. My CR has a finalizer and a controller will clean some dependant resources when adeletionTimeStamp
is added on the CR. When the resources are cleaned up, the finalizer will be removed and the CR will then be cleaned up. My question is that how can I make thecustom_api.delete_namespaced_custom_object
fucntion return after my CR is cleaned up.I've tried adding
propagation_policy='Foreground' and 'Background'
as a parameter to the function but it does not work: It deletes the CR, returns immediately but doesn't wait for it to be cleaned up.Is it possible to implement this feature using
propagation_policy
or any other similar techniques?Describe the solution you'd like to see:
Such code may block until the CR is really deleted.
The text was updated successfully, but these errors were encountered: