// add adds a new Controller to mgr with r as the reconcile.Reconciler
add adds a new Controller to mgr with r as the reconcile.Reconciler
// add adds a new Controller to mgr with r as the reconcile . Reconciler
func add(mgr manager.Manager, r reconcile.Reconciler) error {
	c, err := controller.New("csr-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	csrPredicateFuncs := predicate.Funcs{
		UpdateFunc: func(e event.UpdateEvent) bool {
			return csrPredicate(e.ObjectNew.(*certificatesv1beta1.CertificateSigningRequest))
		},
		CreateFunc: func(e event.CreateEvent) bool {
			return csrPredicate(e.Object.(*certificatesv1beta1.CertificateSigningRequest))
		},
	}
	err = c.Watch(
		&source.Kind{Type: &certificatesv1beta1.CertificateSigningRequest{}},
		&handler.EnqueueRequestForObject{},
		csrPredicateFuncs,
	)
	if err != nil {
		return err
	}
	return nil
}
func add ( mgr manager . Manager , r reconcile . Reconciler ) error { c , err := controller . New ( " " , mgr , controller . Options { Reconciler : r } ) if err != nil { return err } csrPredicateFuncs := predicate . Funcs { UpdateFunc : func ( e event . UpdateEvent ) bool { return csrPredicate ( e . ObjectNew . ( * certificatesv1beta1 . CertificateSigningRequest ) ) } , CreateFunc : func ( e event . CreateEvent ) bool { return csrPredicate ( e . Object . ( * certificatesv1beta1 . CertificateSigningRequest ) ) } , } err = c . Watch ( & source . Kind { Type : & certificatesv1beta1 . CertificateSigningRequest { } } , & handler . EnqueueRequestForObject { } , csrPredicateFuncs , ) if err != nil { return err } return nil }
add adds a new Controller to mgr with r as the reconcile.Reconciler
add adds a new Controller to mgr with r as the reconcile . Reconciler
// Create a new controller // Watch for changes to primary resource ManagedCluster