* feat: update Go version and bump dependencies to support Kubernetes 1.33
* fix: regenerate SharedIndexInformer mock to include AddEventHandlerWithOptions
* Add (failing) unit tests
* Allow retryAfter via custom error type
* Skip OnChange for just-deleted resources
* Fast-track objects not marked for deletion
Added the ability to configure a client's user agent. Added wrappers
for controllers, and factories that provide the ability to configure
the user agent of the clients they use.
This option causes the handle function to only proceed if the
object was actually updated. This is intended to be used by
applications with many objects and/or controllers types that
have alternative means of rerunning when necessary. When the
informer's resync their cache the update function is run.
This reducing the overhead but has the tradeoff of not
rerunning handlers that may rely on external objects or
services or experience a bug causing them to not retry even
if it was necessary. The result is that running the handler
func on resync will mostly only serve the purpose of catching
missed cache events.
While waiting for caches to sync it is possible that one of the resources
calls the sharedcontrollerfactory to acquire a controller. This will cause
a deadlock as the controller is waiting on the cache which is waiting on
a handler which is blocked on the controller.
Problem:
EnqueueKey rate limits the key and is called by sharedcontroller's RegisterHandler.
This is an issue because on startup we start enqueuing each key for each handler, causing the rate limit duration spike to hours very quickly.
Solution:
Adding the key to workqueue directly in EnqueueKey. This is what 2.4.x did as well,
https://github.com/rancher/norman/blob/release/v2.4/controller/generic_controller.go#L187
When shutdown is called the queue consumer could still be processing
items so don't set the workqueue to nil. There is no reason to
nil the workqueue as there is no way to restart a controller.
It most be thrown away and a new one created.