controller

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	// Workers will wait informer caches to be synced
	Synced []cache.InformerSynced
	// Workqueue is a rate limited work queue.
	Workqueue  workqueue.RateLimitingInterface
	Handler    func(key string) error
	MaxRetries int
	Name       string
}

BaseController provides a Controller template for watching a primary resources that defined as CRD.

func (*BaseController) Enqueue

func (c *BaseController) Enqueue(obj interface{})

Enqueue takes a primary resource and converts it into a namespace/name string which is then put onto the work queue. This method should *not* be passed resources of any type other than primary resource.

func (*BaseController) Run

func (c *BaseController) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for Primary resource, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL