Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface{}
type ControllerInit ¶
type ControllerInit interface {
Init(args ControllerInitArguments)
}
ControllerInit new controllers should implement this. It is more flexible in allowing additional options to be passed in
type ControllerInitArguments ¶
type ControllerInitArguments interface { // informers and listers for watching and indexing Kubernetes Resources GetSharedInformers() *SharedInformers // GetRestConfig returns the Config to create new client-go clients GetRestConfig() *rest.Config // Watch uses resourceInformer to watch a resource. When create, update, or deletes // to the resource type are encountered, watch uses watchResourceToReconcileResourceKey // to lookup the key for the resource reconciled by the controller (maybe a different type // than the watched resource), and enqueue it to be reconciled. // watchName: name of the informer. may appear in logs // resourceInformer: gotten from the SharedInformer. controls which resource type is watched // getReconcileKey: takes an instance of the watched resource and returns // a key for the reconciled resource type to enqueue. Watch(watchName string, resourceInformer cache.SharedIndexInformer, getReconcileKey func(interface{}) (string, error)) }
ControllerInitArguments are arguments provided to the Init function for a new controller.
type ControllerInitArgumentsImpl ¶
type ControllerInitArgumentsImpl struct { Si *SharedInformers Rc *rest.Config Rk func(key string) error }
func (ControllerInitArgumentsImpl) GetRestConfig ¶
func (c ControllerInitArgumentsImpl) GetRestConfig() *rest.Config
func (ControllerInitArgumentsImpl) GetSharedInformers ¶
func (c ControllerInitArgumentsImpl) GetSharedInformers() *SharedInformers
func (ControllerInitArgumentsImpl) Watch ¶
func (c ControllerInitArgumentsImpl) Watch( watchName string, resourceInformer cache.SharedIndexInformer, getReconcileKey func(interface{}) (string, error))
Watch uses resourceInformer to watch a resource. When create, update, or deletes to the resource type are encountered, watch uses watchResourceToReconcileResourceKey to lookup the key for the resource reconciled by the controller (maybe a different type than the watched resource), and enqueue it to be reconciled. watchName: name of the informer. may appear in logs resourceInformer: gotten from the SharedInformer. controls which resource type is watched getReconcileKey: takes an instance of the watched resource and returns
a key for the reconciled resource type to enqueue.
type LegacyControllerInit ¶
type LegacyControllerInit interface {
Init(config *rest.Config, si *SharedInformers, r func(key string) error)
}
LegacyControllerInit old controllers may implement this, and we keep it for backwards compatibility.
type SharedInformers ¶
type SharedInformers struct {}
SharedInformers wraps all informers used by controllers so that they are shared across controller implementations
func NewSharedInformers ¶
func NewSharedInformers(config *rest.Config, shutdown <-chan struct{}) *SharedInformers
newSharedInformers returns a set of started informers
func (*SharedInformers) SetupKubernetesTypes ¶
func (si *SharedInformers) SetupKubernetesTypes() bool
SetupKubernetesTypes registers the config for watching Kubernetes types
func (*SharedInformers) StartAdditionalInformers ¶
func (si *SharedInformers) StartAdditionalInformers(shutdown <-chan struct{})
StartAdditionalInformers starts watching Nodes