handlers

package
v0.0.0-...-9632032 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlledResourceHandler

type ControlledResourceHandler struct {
	Logger          *zap.Logger
	WorkQueue       ctrl.WorkQueueProducer
	ControllerIndex ControllerIndex
	ControllerGvk   schema.GroupVersionKind
	Gvk             schema.GroupVersionKind
}

ControlledResourceHandler is a handler for objects the are controlled/owned/produced by some controller object. The controller object is identified by a controller owner reference on the controlled objects. This handler assumes that: - Logger already has the cntrl_gk field set. - controlled and controller objects exist in the same namespace and never across namespaces.

func (*ControlledResourceHandler) OnAdd

func (g *ControlledResourceHandler) OnAdd(obj interface{})

func (*ControlledResourceHandler) OnDelete

func (g *ControlledResourceHandler) OnDelete(obj interface{})

func (*ControlledResourceHandler) OnUpdate

func (g *ControlledResourceHandler) OnUpdate(oldObj, newObj interface{})

type ControllerIndex

type ControllerIndex interface {
	// ControllerByObject returns controller objects that own or want to own an object with a particular Group, Kind,
	// namespace and name. "want to own" means that the object might not exist yet but the controller
	// object would want it to.
	ControllerByObject(gk schema.GroupKind, namespace, name string) ([]runtime.Object, error)
}

ControllerIndex is an index from controlled to controller objects.

type GenericHandler

type GenericHandler struct {
	Logger    *zap.Logger
	WorkQueue ctrl.WorkQueueProducer

	Gvk schema.GroupVersionKind
}

This handler assumes that the Logger already has the obj_gk/ctrl_gk field set.

func (*GenericHandler) OnAdd

func (g *GenericHandler) OnAdd(obj interface{})

func (*GenericHandler) OnDelete

func (g *GenericHandler) OnDelete(obj interface{})

func (*GenericHandler) OnUpdate

func (g *GenericHandler) OnUpdate(oldObj, newObj interface{})

type LookupHandler

type LookupHandler struct {
	Logger    *zap.Logger
	WorkQueue ctrl.WorkQueueProducer
	Gvk       schema.GroupVersionKind

	Lookup func(runtime.Object) ([]runtime.Object, error)
}

LookupHandler is a handler for controlled objects that can be mapped to some controller object through the use of a Lookup function. This handler assumes that the Logger already has the ctrl_gk field set.

func (*LookupHandler) OnAdd

func (e *LookupHandler) OnAdd(obj interface{})

func (*LookupHandler) OnDelete

func (e *LookupHandler) OnDelete(obj interface{})

func (*LookupHandler) OnUpdate

func (e *LookupHandler) OnUpdate(oldObj, newObj interface{})

Jump to

Keyboard shortcuts

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