Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // KeyFunc KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc )
Functions ¶
func Known ¶
func Known() map[string]Constructor
Known returns a map of the registered controller Constructors
func Register ¶
func Register(name string, fn Constructor)
Register registers a controller constructor with the controller package
Types ¶
type BlockingEventHandler ¶
type BlockingEventHandler struct {
WorkFunc func(obj interface{})
}
BlockingEventHandler is an implementation of cache.ResourceEventHandler that simply synchronously calls it's WorkFunc upon calls to OnAdd, OnUpdate or OnDelete.
func (*BlockingEventHandler) Enqueue ¶
func (b *BlockingEventHandler) Enqueue(obj interface{})
Enqueue runs WorkFunc on obj
func (*BlockingEventHandler) OnAdd ¶
func (b *BlockingEventHandler) OnAdd(obj interface{})
OnAdd enqueue obj
func (*BlockingEventHandler) OnDelete ¶
func (b *BlockingEventHandler) OnDelete(obj interface{})
OnDelete enqueue deleted obj
func (*BlockingEventHandler) OnUpdate ¶
func (b *BlockingEventHandler) OnUpdate(old, new interface{})
OnUpdate enqueue new object
type Constructor ¶
Constructor is a function that creates a new control loop given a controller Context.
type Context ¶
type Context struct { // KubeClient is a Kubernetes clientset KubeClient kubernetes.Interface // Client is a mysql clientset Client clientset.Interface // Recorder to record events to Recorder record.EventRecorder // SharedIndexInformer instances for Kubernetes types KubeSharedInformerFactory kubeinformers.SharedInformerFactory // instances SharedInformerFactory informers.SharedInformerFactory // Namespace is a namespace to operate within. This should be used when // constructing SharedIndexInformers for the informer factory. Namespace string }
Context contains the info that controller needs in order to run
type Interface ¶
Interface represents a controller that can run. 'workers' should be the number of independent goroutines for this controller in question that are to be run, and the workers should shut down upon a signal on stopCh. This method should block until all workers have exited cleanly, thus allowing for graceful shutdown of control loops.
type QueuingEventHandler ¶
type QueuingEventHandler struct {
Queue workqueue.RateLimitingInterface
}
QueuingEventHandler is an implementation of cache.ResourceEventHandler that simply queues objects that are added/updated/deleted.
func (*QueuingEventHandler) Enqueue ¶
func (q *QueuingEventHandler) Enqueue(obj interface{})
Enqueue puts object to queue
func (*QueuingEventHandler) OnAdd ¶
func (q *QueuingEventHandler) OnAdd(obj interface{})
OnAdd is the method that enqueue obj
func (*QueuingEventHandler) OnDelete ¶
func (q *QueuingEventHandler) OnDelete(obj interface{})
OnDelete enqueue the deleted object
func (*QueuingEventHandler) OnUpdate ¶
func (q *QueuingEventHandler) OnUpdate(old, new interface{})
OnUpdate enqueue new object