// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
// TODO(user): Modify the Reconcile function to compare the state specified by
// the EventSource object against the actual cluster state, and then
// perform operations to make the cluster state reflect the state specified by
// the user.
//
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
Reconcile is part of the main kubernetes reconciliation loop which aims to
move the current state of the cluster closer to the desired state.
TODO(user): Modify the Reconcile function to compare the state specified by
the EventSource object against the actual cluster state, and then
perform operations to make the cluster state reflect the state specified by
the user.


// Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state . // TODO ( user ) : Modify the Reconcile function to compare the state specified by // the EventSource object against the actual cluster state and then // perform operations to make the cluster state reflect the state specified by // the user . // // For more details check Reconcile and its Result here : // - https : // pkg . go . dev / sigs . k8s . io / controller - runtime@v0 . 8 . 3 / pkg / reconcile
func (r *EventSourceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
	log := r.Log.WithValues("EventSource", req.NamespacedName)
	log.Info("EventSource reconcile starting...")
	eventSource := &ofevent.EventSource{}
	r.EventSourceConfig = &EventSourceConfig{}
	r.EventSourceConfig.LogLevel = DefaultLogLevel
	if err := r.Get(ctx, req.NamespacedName, eventSource); err != nil {
		log.V(1).Info("EventSource deleted", "error", err)
		return ctrl.Result{}, util.IgnoreNotFound(err)
	}
	if err := r.createOrUpdateEventSource(ctx, log, eventSource); err != nil {
		log.Error(err, "Failed to create or update eventsource",
			"namespace", eventSource.Namespace, "name", eventSource.Name)
		return ctrl.Result{}, err
	}
	return ctrl.Result{}, nil
}
func ( r * EventSourceReconciler ) Reconcile ( ctx context . Context , req ctrl . Request ) ( ctrl . Result , error ) { log := r . Log . WithValues ( " " , req . NamespacedName ) log . Info ( " " ) eventSource := & ofevent . EventSource { } r . EventSourceConfig = & EventSourceConfig { } r . EventSourceConfig . LogLevel = DefaultLogLevel if err := r . Get ( ctx , req . NamespacedName , eventSource ) ; err != nil { log . V ( 1 ) . Info ( " " , " " , err ) return ctrl . Result { } , util . IgnoreNotFound ( err ) } if err := r . createOrUpdateEventSource ( ctx , log , eventSource ) ; err != nil { log . Error ( err , " " , " " , eventSource . Namespace , " " , eventSource . Name ) return ctrl . Result { } , err } return ctrl . Result { } , nil }
Reconcile is part of the main kubernetes reconciliation loop which aims to
move the current state of the cluster closer to the desired state.
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state .