// 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(integrationControllerName, mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &wso2v1alpha2.Integration{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}
	 Watch for service
	err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
	if err != nil {
		return err
	}
	return nil
}
func add ( mgr manager . Manager , r reconcile . Reconciler ) error { c , err := controller . New ( integrationControllerName , mgr , controller . Options { Reconciler : r } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & wso2v1alpha2 . Integration { } } , & handler . EnqueueRequestForObject { } ) 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 Integration // TODO(user): Modify this to be the types you create that are owned by the primary resource // Uncomment below if you configure reconcile logic to cater with secondary resources watch // Watch for changes to secondary resource Pods and requeue the owner Integration // Watch for deployment //err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{ //	IsController: true, //	OwnerType:    &wso2v1alpha2.Integration{}, //}) // //// Watch for service //err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{ //	IsController: true, //	OwnerType:    &wso2v1alpha2.Integration{}, //}) // //if err != nil { //	return err //}