From 2429d166603940bdd7bea596c8afcc592cd00ad0 Mon Sep 17 00:00:00 2001 From: zach593 Date: Sat, 23 Nov 2024 15:21:53 +0800 Subject: [PATCH] let rb status controller onCreate predicate return true Signed-off-by: zach593 --- pkg/controllers/status/common.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/status/common.go b/pkg/controllers/status/common.go index 66e516cd05de..a409eadc728d 100644 --- a/pkg/controllers/status/common.go +++ b/pkg/controllers/status/common.go @@ -43,7 +43,13 @@ import ( ) var bindingPredicateFn = builder.WithPredicates(predicate.Funcs{ - CreateFunc: func(e event.CreateEvent) bool { return false }, + CreateFunc: func(event.CreateEvent) bool { + // Although we don't need to process the ResourceBinding immediately upon its creation, + // but it's necessary to ensure that all existing ResourceBindings are processed + // uniformly once when the component restarts. + // This guarantees that no ResourceBinding is missed after a controller restart. + return true + }, UpdateFunc: func(e event.UpdateEvent) bool { var oldResourceVersion, newResourceVersion string