@@ -42,9 +42,7 @@ import (
4242 "sigs.k8s.io/controller-runtime/pkg/client/apiutil"
4343)
4444
45- var (
46- defaultSyncPeriod = 10 * time .Hour
47- )
45+ var defaultSyncPeriod = 10 * time .Hour
4846
4947// InformerGetOptions defines the behavior of how informers are retrieved.
5048type InformerGetOptions internal.GetOptions
@@ -172,6 +170,18 @@ type Options struct {
172170 // is "done" with an object, and would otherwise not requeue it, i.e., we
173171 // recommend the `Reconcile` function return `reconcile.Result{RequeueAfter: t}`,
174172 // instead of `reconcile.Result{}`.
173+ //
174+ // SyncPeriod will trigger update events with the old object being equal to the new
175+ // object. Excep the cache was out of sync.
176+ // If you filter update events like this:
177+ // Controller.Watch(
178+ // &source.Kind{Type: v1.MyCustomKind},
179+ // &handler.EnqueueRequestForObject{},
180+ // predicate.Or(predicate.GenerationChangedPredicate{},
181+ // predicate.LabelChangedPredicate{}))
182+ // then the SyncPeriod will not trigger a Reconcile call, because the update event
183+ // will be ignored by the predicate.
184+
175185 SyncPeriod * time.Duration
176186
177187 // ReaderFailOnMissingInformer configures the cache to return a ErrResourceNotCached error when a user
0 commit comments