func AddApplicationProtocolController(mgr manager.Manager, triggerPush func() error) error {
	metaProtocolCtrl := &MetaProtocolController{Client: mgr.GetClient(), triggerPush: triggerPush}
	c, err := controller.New("aeraki-meta-protocol-application-protocol-controller", mgr,
		controller.Options{Reconciler: metaProtocolCtrl})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &v1alpha1.ApplicationProtocol{}}, &handler.EnqueueRequestForObject{}, metaProtocolPredicates)
	if err != nil {
		return err
	}
	controllerLog.Infof("MetaProtocolApplicationProtocolController registered")
	return nil
}
AddApplicationProtocolController adds ApplicationProtocolController
package controller
import (
	"context"
	"reflect"
	metaprotocolmodel "github.com/aeraki-framework/aeraki/pkg/model/metaprotocol"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"github.com/aeraki-framework/aeraki/client-go/pkg/apis/metaprotocol/v1alpha1"
	"istio.io/pkg/log"
	"sigs.k8s.io/controller-runtime/pkg/controller"
	"sigs.k8s.io/controller-runtime/pkg/event"
	"sigs.k8s.io/controller-runtime/pkg/handler"
	"sigs.k8s.io/controller-runtime/pkg/manager"
	"sigs.k8s.io/controller-runtime/pkg/predicate"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
	"sigs.k8s.io/controller-runtime/pkg/source"
)
var metaProtocolLog = log.RegisterScope("meta-protocol-controller", "meta-protocol-controller debugging", 0)
var (
	metaProtocolPredicates = predicate.Funcs{
		CreateFunc: func(e event.CreateEvent) bool {
			return true
		},
		DeleteFunc: func(e event.DeleteEvent) bool {
			return true
		},
		UpdateFunc: func(e event.UpdateEvent) bool {
			switch old := e.ObjectOld.(type) {
			case *v1alpha1.ApplicationProtocol:
				new, ok := e.ObjectNew.(*v1alpha1.ApplicationProtocol)
				if !ok {
					return false
				}
				if !reflect.DeepEqual(old.Spec, new.Spec) ||
					old.GetDeletionTimestamp() != new.GetDeletionTimestamp() ||
					old.GetGeneration() != new.GetGeneration() {
					return true
				}
			default:
				return false
			}
			return false
		},
	}
)
type MetaProtocolController struct {
	client.Client
	triggerPush func() error
}
func (r *MetaProtocolController) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
	metaProtocolLog.Infof("reconcile: %s/%s", request.Namespace, request.Name)
	if r.triggerPush != nil {
		err := r.triggerPush()
		if err != nil {
			return reconcile.Result{Requeue: true}, err
		}
	}
	protocols := &v1alpha1.ApplicationProtocolList{}
	err := r.List(ctx, protocols)
	if err != nil {
		return reconcile.Result{}, err
	}
	for _, p := range protocols.Items {
		metaProtocolLog.Debugf("register application protocol : %s, codec: %s", p.Spec.Protocol, p.Spec.Codec)
		metaprotocolmodel.SetApplicationProtocolCodec(p.Spec.Protocol, p.Spec.Codec)
	}
	if r.triggerPush != nil {
		err := r.triggerPush()
		if err != nil {
			return reconcile.Result{Requeue: true}, err
		}
	}
	return reconcile.Result{}, nil
}