operator

package
v0.0.0-...-c2045be Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAppLabelFound = errors.New("no app label found ")

Functions

func NewController

func NewController(ep EventProcessor, q workqueue.RateLimitingInterface) *controller

func NewEventProcessor

func NewEventProcessor(o runtime.Object, w ListWatcher, eh EventHandler, h ResourceHandler) *eventProcessor

NewEventProcessor instantiates EventProcessor

func NewResourceEventHandler

func NewResourceEventHandler(f Selector, q workqueue.Interface) *resourceEventHandler

Types

type Event

type Event interface {
	GetKey() string
}

Event wraps k8s updated keys

type EventHandler

type EventHandler interface {
	Add(obj interface{})
	Update(oldObj, newObj interface{})
	Delete(obj interface{})
}

EventHandler gets called on each event variation from informer

type EventProcessor

type EventProcessor interface {
	Run(stopCh chan struct{})
	Handle(ctx context.Context, ev Event) error
}

type ListWatcher

type ListWatcher interface {
	List(options metav1.ListOptions) (runtime.Object, error)
	Watch(options metav1.ListOptions) (watch.Interface, error)
}

ListWatcher defines list and watch methods

type ResourceHandler

type ResourceHandler interface {
	Created(ctx context.Context, obj runtime.Object)
	Updated(ctx context.Context, old, new runtime.Object)
	Deleted(ctx context.Context, obj runtime.Object)
}

ResourceHandler gets called on each resource variation consumed from queue

type Selector

type Selector interface {
	Validate(runtime.Object) error
}

Selector segregates object selection

func NewNopValidator

func NewNopValidator() Selector

func NewSelector

func NewSelector(watchedLabel string) Selector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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