You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other words, that the reconcile could return an expectation with a timeout, and the reconciliation would not be triggered until that expectation predicate is true or it timeouts.
While this sounds nice, and might provide a benefit for the users, execution, we won't have too much space to optimize it, so in terms of execution, it would have to be done anyway in the executor service thread that we use now for reconciliation. So this can be directly transformed to something like this:
Except the timeout for which user might have to track hat in a ConcurrentHashMap or such.
It would be a completely different story if this worked as a cross-cutting filter, where all the event source caches are available.
It would worth to make a prototype, how that would look like, but for that we would need a new abstraction, probably a subset of Context to access secondary resources from the cache and directly event sources in case.
@metacosm
this is also where this would be needed: #2893
So if the primary resource is deleted we cleanup the expectation map, without finalizer/cleaner interface that has to be done on delete event.
To be honest, I'm not convinced at all by this feature and I'm not certain that this brings any value to the SDK, nor what use cases this addresses that cannot already be addressed or that we need to address.
@metacosm@xstefank pls also check the related PR, although it is WIP, and I'm also checking on the specific use cases in the linked operators (especially karpenter since it is a very prominent one) , the challalneg here that is solved for the user is to manage the state for the expectation (thus timeout) and direct the user into right direction.
In future we might add actually generic expectation implementations.
Activity
[-]Integration of expectation[/-][+]Integration of expectations[/+]csviri commentedon Apr 25, 2025
What I could imaging is to have an API that looks something like this:
In other words, that the reconcile could return an expectation with a timeout, and the reconciliation would not be triggered until that expectation predicate is true or it timeouts.
While this sounds nice, and might provide a benefit for the users, execution, we won't have too much space to optimize it, so in terms of execution, it would have to be done anyway in the executor service thread that we use now for reconciliation. So this can be directly transformed to something like this:
Except the timeout for which user might have to track hat in a ConcurrentHashMap or such.
It would be a completely different story if this worked as a cross-cutting filter, where all the event source caches are available.
It would worth to make a prototype, how that would look like, but for that we would need a new abstraction, probably a subset of Context to access secondary resources from the cache and directly event sources in case.
csviri commentedon Apr 25, 2025
cc @xstefank @metacosm @shawkins, maybe something to discuss in the next community meeting.
[-]Integration of expectations[/-][+]Support for expectations pattern[/+]csviri commentedon Jul 8, 2025
see also: https://kubernetes.slack.com/archives/C02MRBMN00Z/p1751979029540209
csviri commentedon Sep 22, 2025
@metacosm
this is also where this would be needed:
#2893
So if the primary resource is deleted we cleanup the expectation map, without finalizer/cleaner interface that has to be done on delete event.
metacosm commentedon Sep 22, 2025
To be honest, I'm not convinced at all by this feature and I'm not certain that this brings any value to the SDK, nor what use cases this addresses that cannot already be addressed or that we need to address.
csviri commentedon Sep 22, 2025
@metacosm isn't is clear from thie blogpost: https://ahmet.im/blog/controller-pitfalls/#expectations-pattern linked to the issue.
we can explain it on community meeting, if that is not clear enough from there. In case pls let me know which part is not clear.
csviri commentedon Sep 22, 2025
Added also link sample expectation from Kubernetes, that might help to understand
csviri commentedon Sep 22, 2025
@metacosm @xstefank pls also check the related PR, although it is WIP, and I'm also checking on the specific use cases in the linked operators (especially karpenter since it is a very prominent one) , the challalneg here that is solved for the user is to manage the state for the expectation (thus timeout) and direct the user into right direction.
In future we might add actually generic expectation implementations.