From d628fc8229a446f46f66814d9f9b38fb255a77ec Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Tue, 23 Jun 2026 13:37:45 -0600 Subject: [PATCH] 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 (cherry picked from commit 7803fac10d2e665756285706ef2d0a8c76241c97) --- pkg/operator/ceph/cluster/predicate.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/cluster/predicate.go b/pkg/operator/ceph/cluster/predicate.go index a706f78de..bfafb6c2e 100644 --- a/pkg/operator/ceph/cluster/predicate.go +++ b/pkg/operator/ceph/cluster/predicate.go @@ -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) },