func (r *IngressReconciler) SetupWithManager(mgr ctrl.Manager) error {
	return ctrl.NewControllerManagedBy(mgr).
		For(&extv1beta1.Ingress{}, builder.WithPredicates(filter.NamespaceFilter())).
		Complete(r)
}
SetupWithManager sets up the controller with the Manager.
package extensionsv1beta1
import (
	"context"
	extv1beta1 "k8s.io/api/extensions/v1beta1"
	netv1 "k8s.io/api/networking/v1"
	"k8s.io/apimachinery/pkg/runtime"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/builder"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/log"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
	"github.com/bfenetworks/ingress-bfe/internal/bfeConfig"
	"github.com/bfenetworks/ingress-bfe/internal/bfeConfig/annotations"
	"github.com/bfenetworks/ingress-bfe/internal/controllers/filter"
	controllerV1 "github.com/bfenetworks/ingress-bfe/internal/controllers/netv1"
)
type IngressReconciler struct {
	BfeConfigBuilder *bfeConfig.ConfigBuilder
	client.Client
	Scheme *runtime.Scheme
}
func (r *IngressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
	log := log.FromContext(ctx)
	log.Info("reconciling ingress", "api version", "ExtensionsV1beta1")
	ingressExtV1beta1 := &extv1beta1.Ingress{}
	err := r.Get(ctx, req.NamespacedName, ingressExtV1beta1)
	if err != nil {
		r.BfeConfigBuilder.DeleteIngress(req.Namespace, req.Name)
		log.V(1).Info("reconcile: ingress delete")
		return reconcile.Result{}, err
	}
	if !filter.MatchIngressClass(ctx, r, ingressExtV1beta1.Annotations, ingressExtV1beta1.Spec.IngressClassName) {
		return reconcile.Result{}, nil
	}
	log.V(1).Info("reconcile: ingress object", "ingress", ingressExtV1beta1)
	ingressV1 := &netv1.Ingress{}
	convert(ingressExtV1beta1, ingressV1)
	err = controllerV1.ReconcileV1Ingress(ctx, r.Client, r.BfeConfigBuilder, ingressV1)
	setStatus(ctx, r.Client, err, ingressExtV1beta1)
	return reconcile.Result{}, err
}