Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
k8s: Add OnAddNode handlers for CiliumNodeUpdater and EndpointManager
The k8s Node watcher receives events related to the local node from the Resource[T] framework Events() method. The Resource[T] framework starts a single informer for each type, alongside a workqueue for each new subscriber that calls the Events() method. The workqueue is used to accumulate the keys related to the objects that are added and/or updated. When Store() is called before Events(), the informer is started, but no queue exists to receive the events yet. Only when the Events() is called, the framework iterates over all the keys in the store to send the related updates to the new subscriber. Doing that, events like an ADD followed by one or more UPDATE might be coalesced in a single ADD event carrying the last available version of the object. What this means for the consumers of the NodeChain subscription mechanism, is that discarding the ADD events with an empty handler might lead to missing update events too. In order to avoid this, all the NodeChain subscribers like the CiliumNodeUpdater and the EndpointManager should have a ADD handler that mimics what their UPDATE handler is already doing. Fixes: #26082 Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
- Loading branch information