Skip to content

How to Understand Why Reconcile Was Called by Controller? #1705

Answered by clux
artsiomkaltovich asked this question in Q&A
Discussion options

You must be logged in to vote

if it possible to differentiate in on_reconcile callback why it has been called?

Short answer is you shouldn't, and instead code defensively around it because of the lack of guaranteed message delivery.
There's a paragraph in https://kube.rs/controllers/reconciler/#reasons-for-reconciliation about it.

"This mapping mechanism ultimately hides the reason for the reconciliation request, and forces you to write an idempotent reconciler." Could you please clarify what is intended to use in such use case? watcher or reflector?

It depends. If you want guaranteed cleanup, then a finalizer gives you guaranteed delivery by blocking deletes until you remove the finalizer. If you don't want to us…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@artsiomkaltovich
Comment options

Answer selected by artsiomkaltovich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants