Use parent func to indicate when the controller queue is a singleton

This prevents unnecessary sync loop runs when the controller is
running with a single worker.  When the controller is running with
more than one worker, it prevents subtle bugs that can cause the
controller to go "back in time."

Signed-off-by: Monis Khan <mok@vmware.com>
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Monis Khan
2020-11-04 11:08:10 -06:00
committed by Matt Moyer
parent e7a817e67a
commit 418f4d20ae
11 changed files with 34 additions and 19 deletions
@@ -31,7 +31,7 @@ func New(cache *authncache.Cache, webhooks authinformers.WebhookAuthenticatorInf
},
controllerlib.WithInformer(
webhooks,
pinnipedcontroller.MatchAnythingFilter(),
pinnipedcontroller.MatchAnythingFilter(pinnipedcontroller.SingletonQueue()),
controllerlib.InformerOption{},
),
)