Does the Operator-SDK guarantee the first call to Reconcile after restarting the operator?

189 Views Asked by At

I have experimentally established that after restarting the operator, Reconcile is called for each object that the operator is watching. Is it guaranteed or is it a side effect of something?

1

There are 1 best solutions below

0
On BEST ANSWER

It's guaranteed / is intentional behavior where the objects in the initial List to populate the cache are sent as create events to the relevant handlers. The reasoning being that resources could be stale by the controller not having been running.

In fact this can cause some issues if for example your controller is watching configmaps as the memory usage of the controller pod on startup may be extremely high or exceed resource quotas.