Skip to content

Commit 463b1da

Browse files
committed
Improve docs for manager.Options.SyncPeriod
The comment tries to capture more of the thoughts exchanged in kubernetes-sigs#88.
1 parent d8385e3 commit 463b1da

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/manager/manager.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ type Options struct {
139139
// value only if you know what you are doing. Defaults to 10 hours if unset.
140140
// there will a 10 percent jitter between the SyncPeriod of all controllers
141141
// so that all controllers will not send list requests simultaneously.
142+
//
143+
// A period sync happens for two reasons:
144+
// 1. To insure against your controller not requeueing an object.
145+
// 2. To insure against controller-runtime, or its dependencies, failing to
146+
// requeue an object, or inadvertently removing it from the requeue.
147+
//
148+
// If you want
149+
// 1. to insure against missed watch events, or
150+
// 2. to poll services that cannot be watched,
151+
// then we recommend that, instead of setting a shorter sync period, your
152+
// controller requeue with a constant duration whenever it is "done," and
153+
// would otherwise not requeue, i.e., we recommend your reconcile loop
154+
// return `reconcile.Result{RequeueAfter: t}`, instead of
155+
// `reconcile.Result{}`.
142156
SyncPeriod *time.Duration
143157

144158
// Logger is the logger that should be used by this manager.

0 commit comments

Comments
 (0)