// New creates the operator controller from configuration. This is the
// controller that handles all the logic for implementing ingress based on
// IngressController resources.
//
// The controller will be pre-configured to watch for IngressController resources
// in the manager namespace.
New creates the operator controller from configuration. This is the
controller that handles all the logic for implementing ingress based on
IngressController resources.

The controller will be pre-configured to watch for IngressController resources
in the manager namespace.
// New creates the operator controller from configuration . This is the // controller that handles all the logic for implementing ingress based on // IngressController resources . // // The controller will be pre - configured to watch for IngressController resources // in the manager namespace .
func New(mgr manager.Manager, config Config) (controller.Controller, error) {
	reconciler := &reconciler{
		Config:   config,
		client:   mgr.GetClient(),
		cache:    mgr.GetCache(),
		recorder: mgr.GetEventRecorderFor("operator-controller"),
	}
	c, err := controller.New("operator-controller", mgr, controller.Options{Reconciler: reconciler})
	if err != nil {
		return nil, err
	}
	if err := c.Watch(&source.Kind{Type: &operatorv1.IngressController{}}, &handler.EnqueueRequestForObject{}); err != nil {
		return nil, err
	}
	if err := c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, enqueueRequestForOwningIngressController(config.Namespace)); err != nil {
		return nil, err
	}
	if err := c.Watch(&source.Kind{Type: &corev1.Service{}}, enqueueRequestForOwningIngressController(config.Namespace)); err != nil {
		return nil, err
	}
	return c, nil
}
func New ( mgr manager . Manager , config Config ) ( controller . Controller , error ) { reconciler := & reconciler { Config : config , client : mgr . GetClient ( ) , cache : mgr . GetCache ( ) , recorder : mgr . GetEventRecorderFor ( " " ) , } c , err := controller . New ( " " , mgr , controller . Options { Reconciler : reconciler } ) if err != nil { return nil , err } if err := c . Watch ( & source . Kind { Type : & operatorv1 . IngressController { } } , & handler . EnqueueRequestForObject { } ) ; err != nil { return nil , err } if err := c . Watch ( & source . Kind { Type : & appsv1 . Deployment { } } , enqueueRequestForOwningIngressController ( config . Namespace ) ) ; err != nil { return nil , err } if err := c . Watch ( & source . Kind { Type : & corev1 . Service { } } , enqueueRequestForOwningIngressController ( config . Namespace ) ) ; err != nil { return nil , err } return c , nil }
New creates the operator controller from configuration.
New creates the operator controller from configuration .