mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #44108 from csbell/fed-disable-orphan
Automatic merge from submit-queue [Federation] Use cascading deletion when deleting resources in underlying clusters The Federation control plane issues a delete command unless it wants to orphan the underlying per-cluster resource. When issuing that command, always set the orphanDependents to false. /release-note-none /sig-federation
This commit is contained in:
		@@ -169,7 +169,8 @@ func NewNamespaceController(client federationclientset.Interface, dynamicClientP
 | 
			
		||||
		},
 | 
			
		||||
		func(client kubeclientset.Interface, obj runtime.Object) error {
 | 
			
		||||
			namespace := obj.(*apiv1.Namespace)
 | 
			
		||||
			err := client.Core().Namespaces().Delete(namespace.Name, &metav1.DeleteOptions{})
 | 
			
		||||
			orphanDependents := false
 | 
			
		||||
			err := client.Core().Namespaces().Delete(namespace.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents})
 | 
			
		||||
			// IsNotFound error is fine since that means the object is deleted already.
 | 
			
		||||
			if errors.IsNotFound(err) {
 | 
			
		||||
				return nil
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user