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

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

	// Watch for changes to secondary resource Pods and requeue the owner KeycloakUser
	err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &kc.KeycloakUser{},
	})
	if err != nil {
		return err
	}

	// Make sure to watch the credential secrets
	err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &kc.KeycloakUser{},
	})
	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("keycloakuser-controller", mgr, controller.Options{Reconciler: r})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &kc.KeycloakUser{}}, &handler.EnqueueRequestForObject{})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Pod{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &kc.KeycloakUser{},
	})
	if err != nil {
		return err
	}
	err = c.Watch(&source.Kind{Type: &corev1.Secret{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &kc.KeycloakUser{},
	})
	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 : & kc . KeycloakUser { } } , & handler . EnqueueRequestForObject { } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Pod { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & kc . KeycloakUser { } , } ) if err != nil { return err } err = c . Watch ( & source . Kind { Type : & corev1 . Secret { } } , & handler . EnqueueRequestForOwner { IsController : true , OwnerType : & kc . KeycloakUser { } , } ) 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 KeycloakUser // Watch for changes to secondary resource Pods and requeue the owner KeycloakUser // Make sure to watch the credential secrets