// DeleteIngress parses a Kubernetes ingress and removes it from the
// ServiceCache
338066
func (s *ServiceCache) DeleteIngress(ingress *types.Ingress) {
	svcID := ParseIngressID(ingress)

	s.mutex.Lock()
	oldService, ok := s.ingresses[svcID]
	endpoints, _ := s.endpoints[svcID]
	delete(s.ingresses, svcID)
	s.mutex.Unlock()

	if ok {
		s.Events <- ServiceEvent{
			Action:    DeleteIngress,
			ID:        svcID,
			Service:   oldService,
			Endpoints: endpoints,
		}
	}
}
1129559
func (m *MockExtensionsV1beta1Interface) Ingresses(arg0 string) v1beta10.IngressInterface {
	ret := m.ctrl.Call(m, "Ingresses", arg0)
	ret0, _ := ret[0].(v1beta10.IngressInterface)
	return ret0
}
581191
func (ic *IngressIPController) clearPersistedAllocation(service *v1.Service, key, errMessage string) error {
	// Assume it is safe to modify the service without worrying about changing the local cache

	if len(errMessage) > 0 {
		utilruntime.HandleError(fmt.Errorf(errMessage))
	} else {
		klog.V(5).Infof("Attempting to clear persisted allocation for service: %v", key)
	}

	// An ingress ip is only allowed in ExternalIPs when a
	// corresponding status exists, so update the spec first to avoid
	// failing admission control.
	ingressIP := service.Status.LoadBalancer.Ingress[0].IP
	for i, ip := range service.Spec.ExternalIPs {
		if ip == ingressIP {
			klog.V(5).Infof("Removing ip %v from the external ips of service %v", ingressIP, key)
			service.Spec.ExternalIPs = append(service.Spec.ExternalIPs[:i], service.Spec.ExternalIPs[i+1:]...)
			if err := ic.persistServiceSpec(service); err != nil {
				return err
			}
			break
		}
	}

	service.Status.LoadBalancer = v1.LoadBalancerStatus{}
	klog.V(5).Infof("Clearing the load balancer status of service: %v", key)
	return ic.persistServiceStatus(service)
}
1311724
func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &v1beta1.IngressList{})
	return err
}
393539
func (c *Client) DeleteNetworkOffering(p *DeleteNetworkOfferingParameter) (*Result, error) {
	obj, err := c.Request("deleteNetworkOffering", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
133637
func (c *client) prunePubPermsCache() {
	r := 0
	for subject := range c.perms.pcache {
		delete(c.perms.pcache, subject)
		if r++; r > pruneSize {
			break
		}
	}
}
160675
func (c *FakeIngressRoutes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewDeleteCollectionAction(ingressroutesResource, c.ns, listOptions)

	_, err := c.Fake.Invokes(action, &v1alpha1.IngressRouteList{})
	return err
}
1086214
func (k *kubernetesClient) UnexposeService(appName string) error {
	logger.Debugf("deleting ingress resource for %s", appName)
	return k.deleteIngress(appName)
}
214095
func (c *FakeIngresses) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{})

	return err
}
11317
func (cache *HealthStatusCache) DeleteInstance(serviceID string, instanceID int) {
	cache.mu.Lock()
	defer cache.mu.Unlock()
	for key := range cache.data {
		if key.ServiceID == serviceID && key.InstanceID == instanceID {
			cache.delete(key)
		}
	}
}
556161
func (s *ServiceCache) DeleteEndpoints(k8sEndpoints *types.Endpoints) ServiceID {
	svcID := ParseEndpointsID(k8sEndpoints)

	s.mutex.Lock()
	service, serviceOK := s.services[svcID]
	delete(s.endpoints, svcID)
	endpoints, serviceReady := s.correlateEndpoints(svcID)
	s.mutex.Unlock()

	if serviceOK {
		event := ServiceEvent{
			Action:    DeleteService,
			ID:        svcID,
			Service:   service,
			Endpoints: endpoints,
		}

		if serviceReady {
			event.Action = UpdateService
		}

		s.Events <- event
	}

	return svcID
}
1157467
func (s *PresenceService) DeleteProxy(name string) error {
	key := backend.Key(proxiesPrefix, name)
	return s.Delete(context.TODO(), key)
}
738748
func (s *ServiceOfferingService) NewDeleteServiceOfferingParams(id string) *DeleteServiceOfferingParams {
	p := &DeleteServiceOfferingParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
1091489
func ConvertToIngress(obj interface{}) interface{} {
	ingress, ok := obj.(*v1beta1.Ingress)
	if !ok {
		return nil
	}
	// TODO check which fields we really need
	return &types.Ingress{
		Ingress: ingress,
	}
}
259318
func (r Network_Interconnect_Tenant) DeleteConnection(receivedObject *datatypes.Network_Interconnect_Tenant) (resp bool, err error) {
	params := []interface{}{
		receivedObject,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Interconnect_Tenant", "deleteConnection", params, &r.Options, &resp)
	return
}
1331969
func ValidateIngressUpdate(ingress, oldIngress *extensions.Ingress) validation.ErrorList {
	allErrs := validation.ErrorList{}
	allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&ingress.ObjectMeta, &oldIngress.ObjectMeta, validation.NewFieldPath("metadata"))...)
	allErrs = append(allErrs, ValidateIngressSpec(&ingress.Spec, validation.NewFieldPath("spec"))...)
	return allErrs
}
1067540
func (s *ServiceCache) DeleteByID(id string, local bool) {
	s.Lock()
	defer s.Unlock()

	hosts := s.remoteHosts
	prefixes := s.remote
	if local {
		hosts = s.localHosts
		prefixes = s.local
	}

	if local {
		s.localPorts = deleteMatchingPorts(s.localPorts, id)
	} else {
		s.remotePorts = deleteMatchingPorts(s.remotePorts, id)
	}

	for host, ports := range hosts {
		hosts[host] = deleteMatchingPorts(ports, id)
		if len(hosts[host]) == 0 {
			delete(hosts, host)
		}
	}

	for l, prefix := range prefixes {
		for ip, ports := range prefix {
			prefix[ip] = deleteMatchingPorts(ports, id)
			if len(prefix[ip]) == 0 {
				delete(prefix, ip)
			}
		}
		if len(prefix) == 0 {
			delete(prefixes, l)
		}
	}
}