common

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventRecorder

func NewEventRecorder(controllerAgentName string, events typedcorev1.EventInterface, logger *log.Entry) record.EventRecorder

NewEventRecorder Creates an event recorder for controller

Types

type Controller

type Controller struct {
	Name                  string
	HandlerOf             string
	KubeClient            kubernetes.Interface
	RadixClient           radixclient.Interface
	WorkQueue             workqueue.RateLimitingInterface
	Informer              cache.SharedIndexInformer
	KubeInformerFactory   kubeinformers.SharedInformerFactory
	Handler               Handler
	Log                   *log.Entry
	WaitForChildrenToSync bool
	Recorder              record.EventRecorder
}

Controller Instance variables

func (*Controller) Enqueue

func (c *Controller) Enqueue(obj interface{}) (requeued bool, err error)

Enqueue takes a resource and converts it into a namespace/name string which is then put onto the work queue

func (*Controller) HandleObject

func (c *Controller) HandleObject(obj interface{}, ownerKind string, getOwnerFn GetOwner)

HandleObject ensures that when anything happens to object which any custom resouce is owner of, that custom resource is synced

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run starts the shared informer, which will be stopped when stopCh is closed.

type GetOwner

type GetOwner func(radixclient.Interface, string, string) (interface{}, error)

GetOwner Function pointer to pass to retrieve owner

type Handler

type Handler interface {
	Sync(namespace, name string, eventRecorder record.EventRecorder) error
}

Handler Common handler interface

type HasSynced

type HasSynced func(bool)

HasSynced Handler to function to report back on sync

Jump to

Keyboard shortcuts

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