// 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("rethinkdbcluster-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &rethinkdbv1alpha1.RethinkDBCluster{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.ConfigMap{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &rethinkdbv1alpha1.RethinkDBCluster{},
	})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.PersistentVolumeClaim{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &rethinkdbv1alpha1.RethinkDBCluster{},
	})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &rethinkdbv1alpha1.RethinkDBCluster{},
	})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &rethinkdbv1alpha1.RethinkDBCluster{},
	})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Service{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &rethinkdbv1alpha1.RethinkDBCluster{},
	})
	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 : & rethinkdbv1alpha1 . RethinkDBCluster { } } , & handler . EnqueueRequestForObject { } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . ConfigMap { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & rethinkdbv1alpha1 . RethinkDBCluster { } , } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . PersistentVolumeClaim { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & rethinkdbv1alpha1 . RethinkDBCluster { } , } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Pod { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & rethinkdbv1alpha1 . RethinkDBCluster { } , } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Secret { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & rethinkdbv1alpha1 . RethinkDBCluster { } , } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Service { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & rethinkdbv1alpha1 . RethinkDBCluster { } , } ) 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 RethinkDBCluster // Watch for changes to secondary resource ConfigMap and requeue the owner RethinkDBCluster // Watch for changes to secondary resource PersistentVolumeClaims and requeue the owner RethinkDBCluster // Watch for changes to secondary resource Pods and requeue the owner RethinkDBCluster // Watch for changes to secondary resource Secret and requeue the owner RethinkDBCluster // Watch for changes to secondary resource Service and requeue the owner RethinkDBCluster