Documentation ¶
Index ¶
- func MarkDeleted(ctx context.Context, obj client.Object) client.Object
- func WasDeleted(ctx context.Context, obj client.Object) bool
- type GVKNN
- type Interface
- type ObjectQueue
- func (q *ObjectQueue) Add(obj client.Object)
- func (q *ObjectQueue) Done(obj client.Object)
- func (q *ObjectQueue) Forget(obj client.Object)
- func (q *ObjectQueue) Get() (client.Object, bool)
- func (q *ObjectQueue) Len() int
- func (q *ObjectQueue) Retry(obj client.Object)
- func (q *ObjectQueue) ShutDown()
- func (q *ObjectQueue) ShuttingDown() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkDeleted ¶
MarkDeleted marks the given Object as having been deleted from the cluster. On receiving a Deleted event, Watchers should call this *first* and then pass the returned Object to Add().
Types ¶
type GVKNN ¶
GVKNN adds Version to core.ID to make it suitable for getting an object from a cluster into an *unstructured.Unstructured.
func (GVKNN) GroupVersionKind ¶
func (gvknn GVKNN) GroupVersionKind() schema.GroupVersionKind
GroupVersionKind returns the GVK contained in this GVKNN.
type Interface ¶
type Interface interface { Add(obj client.Object) Get() (client.Object, bool) Done(obj client.Object) Forget(obj client.Object) Retry(obj client.Object) ShutDown() }
Interface is the methods ObjectQueue satisfies. See ObjectQueue for method definitions.
type ObjectQueue ¶
type ObjectQueue struct {
// contains filtered or unexported fields
}
ObjectQueue is a wrapper around a workqueue.Interface for use with declared resources. It deduplicates work items by their GVKNN. NOTE: This was originally designed to wrap a DelayingInterface, but we have had to copy a lot of that logic here. At some point it may make sense to remove the underlying workqueue.Interface and just consolidate copied logic here.
func New ¶
func New(name string) *ObjectQueue
New creates a new work queue for use in signalling objects that may need remediation.
func (*ObjectQueue) Add ¶
func (q *ObjectQueue) Add(obj client.Object)
Add marks the object as needing processing unless the object is already in the queue AND the existing object is more current than the new one.
func (*ObjectQueue) Done ¶
func (q *ObjectQueue) Done(obj client.Object)
Done marks item as done processing, and if it has been marked as dirty again while it was being processed, it will be re-added to the queue for re-processing.
func (*ObjectQueue) Forget ¶
func (q *ObjectQueue) Forget(obj client.Object)
Forget is a convenience method that allows callers to directly tell the RateLimitingInterface to forget a specific client.Object.
func (*ObjectQueue) Get ¶
func (q *ObjectQueue) Get() (client.Object, bool)
Get blocks until it can return an item to be processed.
Returns the next item to process, and whether the queue has been shut down and has no more items to process.
If the queue has been shut down the caller should end their goroutine.
You must call Done with item when you have finished processing it or else the item will never be processed again.
func (*ObjectQueue) Len ¶
func (q *ObjectQueue) Len() int
Len returns the length of the underlying queue.
func (*ObjectQueue) Retry ¶
func (q *ObjectQueue) Retry(obj client.Object)
Retry schedules the object to be requeued using the rate limiter.
func (*ObjectQueue) ShutDown ¶
func (q *ObjectQueue) ShutDown()
ShutDown shuts down the object queue.
func (*ObjectQueue) ShuttingDown ¶
func (q *ObjectQueue) ShuttingDown() bool
ShuttingDown returns true if the object queue is shutting down.