eventhandlers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

The handlefunctions defines mapping and event handling functions for controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToSelf

func MapToSelf(obj interface{}) string

MapToSelf returns the namespace/name key of obj

Types

type ControllerLookup

type ControllerLookup func(types.ReconcileKey) (interface{}, error)

ControllerLookup takes a ReconcileKey and returns the matching resource

type EventHandler

type EventHandler interface {
	Get(r workqueue.RateLimitingInterface) cache.ResourceEventHandler
}

EventHandler accepts a workqueue and returns ResourceEventHandler that enqueue messages to it for add / update / delete events

type MapAndEnqueue

type MapAndEnqueue struct {
	Predicates []predicates.Predicate
	// Map maps an object to a key that can be enqueued
	Map func(interface{}) string

	MultiMap func(interface{}) []types.ReconcileKey
}

MapAndEnqueue provides Fns to map objects to name/namespace keys and enqueue them as messages

func (MapAndEnqueue) Get

Get returns ResourceEventHandler that Map an object to a Key and enqueue the key if it is non-empty

type MapToController

type MapToController struct {
	Path Path
}

func (MapToController) Map

func (m MapToController) Map(obj interface{}) string

MapToController returns the namespace/name key of the controller for obj

type ObjToKey

type ObjToKey func(interface{}) string

ObjToKey returns a string namespace/name key for an object

type ObjToKeys

type ObjToKeys func(interface{}) []string

type ObjToReconcileKey

type ObjToReconcileKey func(interface{}) types.ReconcileKey

type ObjToReconcileKeys

type ObjToReconcileKeys func(interface{}) []types.ReconcileKey

type Path

type Path []ControllerLookup

Path is list of functions that allow an instance of a resource to be traced back to an owning ancestor. This is done by following the chain of owners references and comparing the UID in the owners reference against the UID of the instance returned by ControllerLookup. e.g. if resource Foo creates Deployments, and wanted to trigger reconciles in response to Pod events created by the Deployment, then Path would contain the following [function to lookup a ReplicaSet by namespace/name, function to lookup a Deployment by namespace/name, function to lookup a Foo by namespace/name]. When a Pod event is observed, this Path could then walk the owners references back to the Foo to get its namespace/name and then reconcile this Foo.

Jump to

Keyboard shortcuts

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