func deleteEndpointSlices(cs clientset.Interface, ns string, svc *v1.Service) {
	listOptions := metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", discoveryv1beta1.LabelServiceName, svc.Name)}
	esList, err := cs.DiscoveryV1beta1().EndpointSlices(ns).List(context.TODO(), listOptions)
	framework.ExpectNoError(err, "Error fetching EndpointSlices for %s/%s Service", ns, svc.Name)

	for _, endpointSlice := range esList.Items {
		err := cs.DiscoveryV1beta1().EndpointSlices(ns).Delete(context.TODO(), endpointSlice.Name, metav1.DeleteOptions{})
		framework.ExpectNoError(err, "Error deleting %s/%s EndpointSlice", ns, endpointSlice.Name)
	}
}
// deleteEndpointSlices deletes EndpointSlices for the specified Service.
deleteEndpointSlices deletes EndpointSlices for the specified Service.
// deleteEndpointSlices deletes EndpointSlices for the specified Service .
func deleteEndpointSlices(cs clientset.Interface, ns string, svc *v1.Service) {
	listOptions := metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", discoveryv1beta1.LabelServiceName, svc.Name)}
	esList, err := cs.DiscoveryV1beta1().EndpointSlices(ns).List(context.TODO(), listOptions)
	framework.ExpectNoError(err, "Error fetching EndpointSlices for %s/%s Service", ns, svc.Name)
	for _, endpointSlice := range esList.Items {
		err := cs.DiscoveryV1beta1().EndpointSlices(ns).Delete(context.TODO(), endpointSlice.Name, metav1.DeleteOptions{})
		framework.ExpectNoError(err, "Error deleting %s/%s EndpointSlice", ns, endpointSlice.Name)
	}
}
func deleteEndpointSlices ( cs clientset . Interface , ns string , svc * v1 . Service ) { listOptions := metav1 . ListOptions { LabelSelector : fmt . Sprintf ( " " , discoveryv1beta1 . LabelServiceName , svc . Name ) } esList , err := cs . DiscoveryV1beta1 ( ) . EndpointSlices ( ns ) . List ( context . TODO ( ) , listOptions ) framework . ExpectNoError ( err , " " , ns , svc . Name ) for _ , endpointSlice := range esList . Items { err := cs . DiscoveryV1beta1 ( ) . EndpointSlices ( ns ) . Delete ( context . TODO ( ) , endpointSlice . Name , metav1 . DeleteOptions { } ) framework . ExpectNoError ( err , " " , ns , endpointSlice . Name ) } }
deleteEndpointSlices deletes EndpointSlices for the specified Service.
deleteEndpointSlices deletes EndpointSlices for the specified Service .