Documentation ¶
Index ¶
- func Enqueue(obj any, q workqueue.RateLimitingInterface)
- func EnqueueAfter(obj any, duration time.Duration, q workqueue.RateLimitingInterface)
- func EnqueueParentObject(obj any, ownerType string, enqueue func(obj any), ...)
- func EnqueueRateLimited(obj any, q workqueue.RateLimitingInterface)
- func InstanceIDRequirement(instanceID string) labels.Requirement
- func RunWorker(ctx context.Context, workqueue workqueue.RateLimitingInterface, objType string, ...)
- func WatchResource(client dynamic.Interface, namespace string, gvk schema.GroupVersionResource, ...) error
- func WatchResourceWithExponentialBackoff(stopCh <-chan struct{}, client dynamic.Interface, namespace string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enqueue ¶
func Enqueue(obj any, q workqueue.RateLimitingInterface)
func EnqueueAfter ¶
func EnqueueAfter(obj any, duration time.Duration, q workqueue.RateLimitingInterface)
func EnqueueParentObject ¶
func EnqueueParentObject(obj any, ownerType string, enqueue func(obj any), parentGetter ...func(any) (*metav1.OwnerReference, string))
EnqueueParentObject will take any resource implementing metav1.Object and attempt to find the ownerType resource that 'owns' it. It does this by looking at the objects metadata.ownerReferences field for an appropriate OwnerReference. It then enqueues that ownerType resource to be processed. If the object does not have an appropriate OwnerReference, it will simply be skipped. This function assumes parent object is in the same namespace as the child
func EnqueueRateLimited ¶
func EnqueueRateLimited(obj any, q workqueue.RateLimitingInterface)
func InstanceIDRequirement ¶
func InstanceIDRequirement(instanceID string) labels.Requirement
InstanceIDRequirement returns the label requirement to filter against a controller instance (or not)
func RunWorker ¶
func RunWorker(ctx context.Context, workqueue workqueue.RateLimitingInterface, objType string, syncHandler func(context.Context, string) error, metricServer *metrics.MetricsServer)
RunWorker is a long-running function that will continually call the processNextWorkItem function in order to read and process a message on the workqueue.
func WatchResource ¶
func WatchResource(client dynamic.Interface, namespace string, gvk schema.GroupVersionResource, queue workqueue.RateLimitingInterface, indexer cache.Indexer, index string) error
WatchResource is a long-running function that will continually call the processNextWatchObj function in order to watch changes on a resource kind and enqueue a different resources kind that interact with them
func WatchResourceWithExponentialBackoff ¶
func WatchResourceWithExponentialBackoff(stopCh <-chan struct{}, client dynamic.Interface, namespace string, gvk schema.GroupVersionResource, queue workqueue.RateLimitingInterface, indexer cache.Indexer, index string)
WatchResourceWithExponentialBackoff creates a watch for the gvk provided. If there are any error, the function will rety again using exponential backoff. It starts at 1 second wait, and wait afterwards increases by a factor of 2 and caps at 5 minutes.
Types ¶
This section is empty.