core: skip node watcher during initial cache sync
When the operator starts, there is no need to handle the
node watcher immediately while the controller runtime
cache is being initialized. The cluster will anyway be
fully reconciled and create new OSDs if needed. The node
watcher is only intended for triggering a reconcile when
a node is added or updated at a later time after a sync
would anyway be triggered.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 7803fac10d)
This commit is contained in:
1 parent
75fc4482e0
commit
d628fc8229
1 file changed
+4
-1
@@ -68,7 +68,10 @@ func predicateForNodeWatcher[T *corev1.Node](ctx context.Context, client client.
|
||||
return predicate.TypedFuncs[T]{
|
||||
CreateFunc: func(e event.TypedCreateEvent[T]) bool {
|
||||
obj := (*corev1.Node)(e.Object)
|
||||
|
||||
if e.IsInInitialList {
|
||||
// Skip node handling while the controller runtime is initializing the cache.
|
||||
return false
|
||||
}
|
||||
clientCluster := newClientCluster(client, obj.GetNamespace(), context)
|
||||
return clientCluster.onK8sNode(ctx, obj, opNamespace)
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user