mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 19:58:17 +00:00
Automatic merge from submit-queue federation: Refactoring namespaced resources deletion code from kube ns controller and sharing it with fed ns controller Ref https://github.com/kubernetes/kubernetes/issues/33612 Refactoring code in kube namespace controller to delete all resources in a namespace when the namespace is deleted. Refactored this code into a separate NamespacedResourcesDeleter class and calling it from federation namespace controller. This is required for enabling cascading deletion of namespaced resources in federation apiserver. Before this PR, we were directly deleting the namespaced resources and assuming that they go away immediately. With cascading deletion, we will have to wait for the corresponding controllers to first delete the resources from underlying clusters and then delete the resource from federation control plane. NamespacedResourcesDeleter has this waiting logic. cc @kubernetes/sig-federation-misc @caesarxuchao @derekwaynecarr @mwielgus