func deleteIngressOrFail(clientset *fedclientset.Clientset, namespace string, ingressName string) { if clientset == nil || len(namespace) == 0 || len(ingressName) == 0 { Fail(fmt.Sprintf("Internal error: invalid parameters passed to deleteIngressOrFail: clientset: %v, namespace: %v, ingress: %v", clientset, namespace, ingressName)) } err := clientset.Ingresses(namespace).Delete(ingressName, v1.NewDeleteOptions(0)) framework.ExpectNoError(err, "Error deleting ingress %q from namespace %q", ingressName, namespace) }
func deleteIngressOrFail(clientset *fedclientset.Clientset, namespace string, ingressName string, orphanDependents *bool) { if clientset == nil || len(namespace) == 0 || len(ingressName) == 0 { Fail(fmt.Sprintf("Internal error: invalid parameters passed to deleteIngressOrFail: clientset: %v, namespace: %v, ingress: %v", clientset, namespace, ingressName)) } err := clientset.Ingresses(namespace).Delete(ingressName, &v1.DeleteOptions{OrphanDependents: orphanDependents}) framework.ExpectNoError(err, "Error deleting ingress %q from namespace %q", ingressName, namespace) // Wait for the ingress to be deleted. err = wait.Poll(framework.Poll, wait.ForeverTestTimeout, func() (bool, error) { _, err := clientset.Extensions().Ingresses(namespace).Get(ingressName) if err != nil && errors.IsNotFound(err) { return true, nil } return false, err }) if err != nil { framework.Failf("Error in deleting ingress %s: %v", ingressName, err) } }