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

	// Watch for changes to primary resource API
	err = c.Watch(&source.Kind{Type: &wso2v1alpha1.API{}}, &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 API
	err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &wso2v1alpha1.API{},
	})
	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(
		"api-controller",
		mgr,
		controller.Options{
			MaxConcurrentReconciles: 10,
			Reconciler:              r,
		},
	)
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &wso2v1alpha1.API{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &wso2v1alpha1.API{},
	})
	if err != nil {
		return err
	}
	return nil
}
func add ( mgr manager . Manager , r reconcile . Reconciler ) error { c , err := controller . New ( " " , mgr , controller . Options { MaxConcurrentReconciles : 10 , Reconciler : r , } , ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & wso2v1alpha1 . API { } } , & handler . EnqueueRequestForObject { } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Pod { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & wso2v1alpha1 . API { } , } ) 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 API // 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 API