Documentation ¶
Index ¶
- func EnqueueForParentHandler(q Queue, kind config.GroupVersionKind) func(obj Object)
- func FilteredObjectHandler(handler func(o Object), filter func(o Object) bool) cache.ResourceEventHandler
- func FilteredObjectSpecHandler(handler func(o Object), filter func(o Object) bool) cache.ResourceEventHandler
- func IgnoreNotFound(err error) error
- func ObjectHandler(handler func(o Object)) cache.ResourceEventHandler
- func ObjectToGVR(u Object) (schema.GroupVersionResource, error)
- func UnstructuredToGVR(u unstructured.Unstructured) (schema.GroupVersionResource, error)
- func WithGenericReconciler(f func(key interface{}) error) func(q *Queue)
- func WithMaxAttempts(n int) func(q *Queue)
- func WithName(name string) func(q *Queue)
- func WithRateLimiter(r workqueue.RateLimiter) func(q *Queue)
- func WithReconciler(f func(key types.NamespacedName) error) func(q *Queue)
- type Object
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueForParentHandler ¶
func EnqueueForParentHandler(q Queue, kind config.GroupVersionKind) func(obj Object)
EnqueueForParentHandler returns a handler that will enqueue the parent (by ownerRef) resource
func FilteredObjectHandler ¶
func FilteredObjectHandler(handler func(o Object), filter func(o Object) bool) cache.ResourceEventHandler
FilteredObjectHandler returns a handler that will act on the latest version of an object This means Add/Update/Delete are all handled the same and are just used to trigger reconciling. If filters are set, returning 'false' will exclude the event. For Add and Deletes, the filter will be based on the new or old item. For updates, the item will be handled if either the new or the old object is updated.
func FilteredObjectSpecHandler ¶
func FilteredObjectSpecHandler(handler func(o Object), filter func(o Object) bool) cache.ResourceEventHandler
FilteredObjectSpecHandler returns a handler that will act on the latest version of an object This means Add/Update/Delete are all handled the same and are just used to trigger reconciling. Unlike FilteredObjectHandler, the handler is only trigger when the resource spec changes (ie resourceVersion) If filters are set, returning 'false' will exclude the event. For Add and Deletes, the filter will be based on the new or old item. For updates, the item will be handled if either the new or the old object is updated.
func IgnoreNotFound ¶
IgnoreNotFound returns nil on NotFound errors. All other values that are not NotFound errors or nil are returned unmodified.
func ObjectHandler ¶
func ObjectHandler(handler func(o Object)) cache.ResourceEventHandler
ObjectHandler returns a handler that will act on the latest version of an object This means Add/Update/Delete are all handled the same and are just used to trigger reconciling.
func ObjectToGVR ¶
func ObjectToGVR(u Object) (schema.GroupVersionResource, error)
ObjectToGVR extracts the GVR of an unstructured resource. This is useful when using dynamic clients.
func UnstructuredToGVR ¶
func UnstructuredToGVR(u unstructured.Unstructured) (schema.GroupVersionResource, error)
UnstructuredToGVR extracts the GVR of an unstructured resource. This is useful when using dynamic clients.
func WithGenericReconciler ¶
WithGenericReconciler defines the handler function to handle items in the queue that can handle any type
func WithMaxAttempts ¶
WithMaxAttempts allows defining a custom max attempts for the queue. If not set, items will not be retried
func WithRateLimiter ¶
func WithRateLimiter(r workqueue.RateLimiter) func(q *Queue)
WithRateLimiter allows defining a custom rate limitter for the queue
func WithReconciler ¶
func WithReconciler(f func(key types.NamespacedName) error) func(q *Queue)
WithReconciler defines the handler function to handle items in the queue.
Types ¶
type Object ¶
Object is a union of runtime + meta objects. Essentially every k8s object meets this interface. and certainly all that we care about.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue defines an abstraction around Kubernetes' workqueue. Items enqueued are deduplicated; this generally means relying on ordering of events in the queue is not feasible.