func add(mgr manager.Manager, r reconcile.Reconciler) error {
	// Create a new controller
	c, err := controller.New("integration-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}

	// Watch for changes to primary resource Integration
	err = c.Watch(&source.Kind{Type: &wso2v1alpha1.Integration{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}

	// TODO(user): Modify this to be the types you create that are owned by the primary resource
	// 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:    &wso2v1alpha1.Integration{},
	})

	// Watch for service
	err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &wso2v1alpha1.Integration{},
	})

	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
// 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("integration-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &wso2v1alpha1.Integration{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &wso2v1alpha1.Integration{},
	})
	err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &wso2v1alpha1.Integration{},
	})
	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 } err = c . Watch ( & source . Kind { Type : & wso2v1alpha1 . Integration { } } , & handler . EnqueueRequestForObject { } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & appsv1 . Deployment { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & wso2v1alpha1 . Integration { } , } ) err = c . Watch ( & source . Kind { Type : & corev1 . Service { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & wso2v1alpha1 . Integration { } , } ) 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 // Watch for changes to secondary resource Pods and requeue the owner Integration // Watch for deployment // Watch for service