// ensureIngressDeleted tries to delete ingress, and if successful, will remove
// the finalizer.
ensureIngressDeleted tries to delete ingress, and if successful, will remove
the finalizer.
// ensureIngressDeleted tries to delete ingress and if successful will remove // the finalizer .
func (r *reconciler) ensureIngressDeleted(ingress *operatorv1.IngressController, dnsConfig *configv1.DNS, infraConfig *configv1.Infrastructure) error {
	if err := r.finalizeLoadBalancerService(ingress, dnsConfig); err != nil {
		return fmt.Errorf("failed to finalize load balancer service for %s: %v", ingress.Name, err)
	}
	log.Info("finalized load balancer service for ingress", "namespace", ingress.Namespace, "name", ingress.Name)
	if err := r.ensureRouterDeleted(ingress); err != nil {
		return fmt.Errorf("failed to delete deployment for ingress %s: %v", ingress.Name, err)
	}
	log.Info("deleted deployment for ingress", "namespace", ingress.Namespace, "name", ingress.Name)
	if slice.ContainsString(ingress.Finalizers, IngressControllerFinalizer) {
		updated := ingress.DeepCopy()
		updated.Finalizers = slice.RemoveString(updated.Finalizers, IngressControllerFinalizer)
		if err := r.client.Update(context.TODO(), updated); err != nil {
			return fmt.Errorf("failed to remove finalizer from ingresscontroller %s: %v", ingress.Name, err)
		}
	}
	return nil
}
func ( r * reconciler ) ensureIngressDeleted ( ingress * operatorv1 . IngressController , dnsConfig * configv1 . DNS , infraConfig * configv1 . Infrastructure ) error { if err := r . finalizeLoadBalancerService ( ingress , dnsConfig ) ; err != nil { return fmt . Errorf ( " " , ingress . Name , err ) } log . Info ( " " , " " , ingress . Namespace , " " , ingress . Name ) if err := r . ensureRouterDeleted ( ingress ) ; err != nil { return fmt . Errorf ( " " , ingress . Name , err ) } log . Info ( " " , " " , ingress . Namespace , " " , ingress . Name ) if slice . ContainsString ( ingress . Finalizers , IngressControllerFinalizer ) { updated := ingress . DeepCopy ( ) updated . Finalizers = slice . RemoveString ( updated . Finalizers , IngressControllerFinalizer ) if err := r . client . Update ( context . TODO ( ) , updated ) ; err != nil { return fmt . Errorf ( " " , ingress . Name , err ) } } return nil }
ensureIngressDeleted tries to delete ingress, and if successful, will remove
the finalizer.
ensureIngressDeleted tries to delete ingress and if successful will remove the finalizer .
// Clean up the finalizer to allow the ingresscontroller to be deleted.