Documentation ¶
Index ¶
- func Enqueue(obj interface{}, q workqueue.RateLimitingInterface)
- func EnqueueAfter(obj interface{}, duration time.Duration, q workqueue.RateLimitingInterface)
- func EnqueueParentObject(obj interface{}, ownerType string, enqueue func(obj interface{}))
- func EnqueueRateLimited(obj interface{}, q workqueue.RateLimitingInterface)
- func InstanceIDRequirement(instanceID string) labels.Requirement
- func RunWorker(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 interface{}, q workqueue.RateLimitingInterface)
func EnqueueAfter ¶
func EnqueueAfter(obj interface{}, duration time.Duration, q workqueue.RateLimitingInterface)
func EnqueueParentObject ¶
func EnqueueParentObject(obj interface{}, ownerType string, enqueue func(obj interface{}))
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 interface{}, q workqueue.RateLimitingInterface)
func InstanceIDRequirement ¶ added in v0.7.0
func InstanceIDRequirement(instanceID string) labels.Requirement
InstanceIDRequirement returns the label requirement to filter against a controller instance (or not)
func RunWorker ¶
func RunWorker(workqueue workqueue.RateLimitingInterface, objType string, syncHandler func(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 ¶ added in v0.7.0
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 ¶ added in v0.7.0
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.