Change:
Problem: When users sends a cascading deletion request to federation i.e they set orphanDependents=false, then federation should also set orphanDependents=false, when it sends the request to underlying clusters.
Fixed by

Discussion:
}, func(client kubeclientset.Interface, obj pkgruntime.Object) error { configmap := obj.(*apiv1.ConfigMap) <del> err := client.Core().ConfigMaps(configmap.Namespace).Delete(configmap.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Core().ConfigMaps(configmap.Namespace).Delete(configmap.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

func(client kubeclientset.Interface, obj pkgruntime.Object) error { daemonset := obj.(*extensionsv1.DaemonSet) glog.V(4).Infof("Attempting to delete daemonset: %s/%s", daemonset.Namespace, daemonset.Name) <del> err := client.Extensions().DaemonSets(daemonset.Namespace).Delete(daemonset.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Extensions().DaemonSets(daemonset.Namespace).Delete(daemonset.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> if err != nil { glog.Errorf("Error deleting daemonset %s/%s/: %v", daemonset.Namespace, daemonset.Name, err) } else {

}, func(client kubeclientset.Interface, obj runtime.Object) error { rs := obj.(*extensionsv1.Deployment) <del> err := client.Extensions().Deployments(rs.Namespace).Delete(rs.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Extensions().Deployments(rs.Namespace).Delete(rs.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

func(client kubeclientset.Interface, obj pkgruntime.Object) error { ingress := obj.(*extensionsv1beta1.Ingress) glog.V(4).Infof("Attempting to delete Ingress: %v", ingress) <del> err := client.Extensions().Ingresses(ingress.Namespace).Delete(ingress.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Extensions().Ingresses(ingress.Namespace).Delete(ingress.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

}, func(client kubeclientset.Interface, obj runtime.Object) error { namespace := obj.(*apiv1.Namespace) <del> err := client.Core().Namespaces().Delete(namespace.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Core().Namespaces().Delete(namespace.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> // IsNotFound error is fine since that means the object is deleted already. if errors.IsNotFound(err) { return nil

}, func(client kubeclientset.Interface, obj runtime.Object) error { rs := obj.(*extensionsv1.ReplicaSet) <del> err := client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

}, func(client kubeclientset.Interface, obj pkgruntime.Object) error { secret := obj.(*apiv1.Secret) <del> err := client.Core().Secrets(secret.Namespace).Delete(secret.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Core().Secrets(secret.Namespace).Delete(secret.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

}, func(client kubeclientset.Interface, obj pkgruntime.Object) error { svc := obj.(*v1.Service) <del> err := client.Core().Services(svc.Namespace).Delete(svc.Name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false err := client.Core().Services(svc.Namespace).Delete(svc.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> return err })

// deleteSecret deletes the secret with the given name from the host // cluster. func deleteSecret(clientset internalclientset.Interface, name, namespace string) error { <del> return clientset.Core().Secrets(namespace).Delete(name, &metav1.DeleteOptions{}) </del> <ins> orphanDependents := false return clientset.Core().Secrets(namespace).Delete(name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) </ins> } // isNotFound checks if the given error is a NotFound status error.