func AddDaemonReconciler(mgr manager.Manager) error {
	r := &DaemonReconciler{client: mgr.GetClient(), scheme: mgr.GetScheme()}
	// Create a new controller
	c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}

	// The controller will ignore the name part of the enqueued request as
	// every reconcile gathers multiple resources an acts on a few one-per-namespace objects.
	enqueueOnlyNamespace := &handler.EnqueueRequestsFromMapFunc{
		ToRequests: handler.ToRequestsFunc(func(obj handler.MapObject) []reconcile.Request {
			req := reconcile.Request{
				NamespacedName: types.NamespacedName{Namespace: obj.Meta.GetNamespace()},
			}
			return []reconcile.Request{req}
		}),
	}

	// Watch for changes to primary resource LocalVolumeSet
	err = c.Watch(&source.Kind{Type: &localv1alpha1.LocalVolumeSet{}}, enqueueOnlyNamespace)
	if err != nil {
		return err
	}

	// watch provisioner, diskmaker-manager daemonsets
	err = c.Watch(&source.Kind{Type: &appsv1.DaemonSet{}}, enqueueOnlyNamespace, common.EnqueueOnlyLabeledSubcomponents(DiskMakerName, ProvisionerName))
	if err != nil {
		return err
	}

	// watch provisioner configmap
	err = c.Watch(&source.Kind{Type: &corev1.ConfigMap{}}, enqueueOnlyNamespace, common.EnqueueOnlyLabeledSubcomponents(ProvisionerConfigMapName))
	if err != nil {
		return err
	}

	return nil
}
// AddDaemonReconciler adds a new Controller to mgr with r as the reconcile.Reconciler
// this controller manages creation and scheduling of the diskmaker manager and provisioner daemonsets
AddDaemonReconciler adds a new Controller to mgr with r as the reconcile.Reconciler
this controller manages creation and scheduling of the diskmaker manager and provisioner daemonsets
// AddDaemonReconciler adds a new Controller to mgr with r as the reconcile . Reconciler // this controller manages creation and scheduling of the diskmaker manager and provisioner daemonsets
func AddDaemonReconciler(mgr manager.Manager) error {
	r := &DaemonReconciler{client: mgr.GetClient(), scheme: mgr.GetScheme()}
	c, err := controller.New(controllerName, mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	enqueueOnlyNamespace := &handler.EnqueueRequestsFromMapFunc{
		ToRequests: handler.ToRequestsFunc(func(obj handler.MapObject) []reconcile.Request {
			req := reconcile.Request{
				NamespacedName: types.NamespacedName{Namespace: obj.Meta.GetNamespace()},
			}
			return []reconcile.Request{req}
		}),
	}
	err = c.Watch(&source.Kind{Type: &localv1alpha1.LocalVolumeSet{}}, enqueueOnlyNamespace)
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &appsv1.DaemonSet{}}, enqueueOnlyNamespace, common.EnqueueOnlyLabeledSubcomponents(DiskMakerName, ProvisionerName))
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.ConfigMap{}}, enqueueOnlyNamespace, common.EnqueueOnlyLabeledSubcomponents(ProvisionerConfigMapName))
	if err != nil {
		return err
	}
	return nil
}
func AddDaemonReconciler ( mgr manager . Manager ) error { r := & DaemonReconciler { client : mgr . GetClient ( ) , scheme : mgr . GetScheme ( ) } c , err := controller . New ( controllerName , mgr , controller . Options { Reconciler : r } ) if err != nil { return err } enqueueOnlyNamespace := & handler . EnqueueRequestsFromMapFunc { ToRequests : handler . ToRequestsFunc ( func ( obj handler . MapObject ) [ ] reconcile . Request { req := reconcile . Request { NamespacedName : types . NamespacedName { Namespace : obj . Meta . GetNamespace ( ) } , } return [ ] reconcile . Request { req } } ) , } err = c . Watch ( & source . Kind { Type : & localv1alpha1 . LocalVolumeSet { } } , enqueueOnlyNamespace ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & appsv1 . DaemonSet { } } , enqueueOnlyNamespace , common . EnqueueOnlyLabeledSubcomponents ( DiskMakerName , ProvisionerName ) ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . ConfigMap { } } , enqueueOnlyNamespace , common . EnqueueOnlyLabeledSubcomponents ( ProvisionerConfigMapName ) ) if err != nil { return err } return nil }
AddDaemonReconciler adds a new Controller to mgr with r as the reconcile.Reconciler
this controller manages creation and scheduling of the diskmaker manager and provisioner daemonsets
AddDaemonReconciler adds a new Controller to mgr with r as the reconcile . Reconciler this controller manages creation and scheduling of the diskmaker manager and provisioner daemonsets
// Create a new controller // The controller will ignore the name part of the enqueued request as // every reconcile gathers multiple resources an acts on a few one-per-namespace objects. // Watch for changes to primary resource LocalVolumeSet // watch provisioner, diskmaker-manager daemonsets // watch provisioner configmap