mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Add an Enqueue method to framework.Controller
Allows clients to requeue delta events in the event they need to delay processing.
This commit is contained in:
parent
213e7a8ab6
commit
61c7beb51f
@ -106,6 +106,16 @@ func (c *Controller) HasSynced() bool {
|
|||||||
return c.reflector.LastSyncResourceVersion() != ""
|
return c.reflector.LastSyncResourceVersion() != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Requeue adds the provided object back into the queue if it does not already exist.
|
||||||
|
func (c *Controller) Requeue(obj interface{}) error {
|
||||||
|
return c.config.Queue.AddIfNotPresent(cache.Deltas{
|
||||||
|
cache.Delta{
|
||||||
|
Type: cache.Sync,
|
||||||
|
Object: obj,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// processLoop drains the work queue.
|
// processLoop drains the work queue.
|
||||||
// TODO: Consider doing the processing in parallel. This will require a little thought
|
// TODO: Consider doing the processing in parallel. This will require a little thought
|
||||||
// to make sure that we don't end up processing the same object multiple times
|
// to make sure that we don't end up processing the same object multiple times
|
||||||
|
Loading…
Reference in New Issue
Block a user