-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: StatusModified Event must support returning ResourceControllerResult #579
Comments
First, sorry for misleading, I accdentally published this issue with the wrong account but in fact im in charge of this issue. I've advertised that throwing an exception from withing StatusModified method "fixes" this issue, which makes me believe this actually could be a bug related with the EventQueue, and not an actual intended behaviour. After throwing the exception the new reconcile occurs immediately after the exception. For the time being I have no clue of how returning Task.CompletedTask, and continuing the execution normally, prevents to manage the Event that was previously registered at ReconcileAsync. |
We are facing the same issue and are struggling to find a workaround. We even tried throwing the exception, but this makes the reconciliation process repeat immediately, not after the desired delay (but also throwing an exception isn't a valid workaround). This happens every time we try and return a RequeueEvent from ReconcileAsync. |
@jamescooke-vwfs pls take a look at #585 seems like a working solution could be reach soon |
Watcher and Local events are now merged to produce a sequence containing all captured events instead of just the sequence that was last produced. Events will still be switch but only at group level, grouping by resource Uid and sub-grouping by event type, therefore Keeping always last event for each type of each resources, preventing events accumulation. Fixes #585 #579
This has drastically changed in V8. |
Describe the bug
Reconcile event supports returning ResourceControllerResult specifying not only the event to requeue but also a TimeSpan to schedule the next execution.
Currently Reconcile, StatusModified and Deleted are the supported events. Since StatusModified is triggered automatically on CustomResource Status changes, it just feels weird for reconcile to return ResourceControllerResult enqueuing a StatusModified event if no changes happened, and if event is gonna be triggered automatically in case something changed on the status.
Now to explain the scenario. As explained on the docs, it makes sense to requeue the reconcile under some circustances, like checking database connection. on my specific case, I've few controllers, and the two mostly impacted are a controller executing monitoring of the entire cluster and a controller implementing autoscaling features (a bit smarter than HPA basically making use of k8s CustomMetrics and some others). Both of them have quite a lot reasons to update the CustomResource Entity Status that is being reconciled, during the execution of the reconcile event, for everything to be automated and keep track of what each controller is dicovering on each execution.
However, by doing so, right after Reconcile event, StatusModified Event is triggered, which returns "Event type "StatusUpdated" on resource "Kheiron/kheiron" successfully reconciled. Requeue not possible." and breaks the next execution of Reconcile event, not happening on the specific timespan that was returned, but on the default of 5 minutes. This happens regardless of playing with OperatorSettings.DefaultRequeueAsSameType or returning ResourceControllerResult.RequeueEvent(requeue, ResourceEventType.Reconcile)
From my perspective, to fix this StatusModified must be able to return null if nothing needs to be requeued or ResourceControllerResult to enqueue a new Reconcile event.
To reproduce
Expected behavior
Screenshots
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: