@@ -42,9 +42,7 @@ import (
42
42
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
43
43
)
44
44
45
- var (
46
- defaultSyncPeriod = 10 * time .Hour
47
- )
45
+ var defaultSyncPeriod = 10 * time .Hour
48
46
49
47
// InformerGetOptions defines the behavior of how informers are retrieved.
50
48
type InformerGetOptions internal.GetOptions
@@ -172,6 +170,18 @@ type Options struct {
172
170
// is "done" with an object, and would otherwise not requeue it, i.e., we
173
171
// recommend the `Reconcile` function return `reconcile.Result{RequeueAfter: t}`,
174
172
// 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
+
175
185
SyncPeriod * time.Duration
176
186
177
187
// ReaderFailOnMissingInformer configures the cache to return a ErrResourceNotCached error when a user
0 commit comments