controller

package
v0.0.0-...-9f13f69 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 5 Imported by: 16

Documentation

Overview

Kubernetes controller boilerplate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHandler

AddHandler creates and adds an event handler to the informer. It returns the queue associated to the event handler.

func NewEventHandler

func NewEventHandler(kind string, queue workqueue.Interface) cache.ResourceEventHandler

NewEventHandler creates an event handler which just adds events to the given queue.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller describes a controller to watch the given GVK events.

func NewController

func NewController(gvk schema.GroupVersionKind, informer cache.SharedIndexInformer, handler Handler) *Controller

NewController creates a controller.

func (*Controller) GetQueue

func (c *Controller) GetQueue() workqueue.Interface

GetQueue returns the event queue used by the controller. It can be useful to inject extra events for the controller. See pkg/converter/endpoints/controller.go for an example.

func (*Controller) Run

func (c *Controller) Run()

Run executes the controller.

type Handler

type Handler interface {
	Update(string, schema.GroupVersionKind, interface{}) error
	Delete(string) error
}

Handler is a set of callbacks to process events on the queue.

Jump to

Keyboard shortcuts

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