Documentation ¶
Overview ¶
Package controller provides utilties for working with controllers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultNewCacheFn NewCacheFn = cache.New DefaultNewControllerFn NewControllerFn = controller.NewUnmanaged )
The default new cache and new controller functions.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
An Engine manages the lifecycles of controller-runtime controllers (and their caches). The lifecycles of the controllers are not coupled to lifecycle of the engine, nor to the lifecycle of the controller manager it uses.
func NewEngine ¶
func NewEngine(mgr manager.Manager, o ...EngineOption) *Engine
NewEngine produces a new Engine.
func (*Engine) Err ¶
Err returns any error encountered by the named controller. The returned error is always nil if the named controller is running.
func (*Engine) IsRunning ¶
IsRunning indicates whether the named controller is running - i.e. whether it has been started and does not appear to have crashed.
type EngineOption ¶
type EngineOption func(*Engine)
An EngineOption configures an Engine.
func WithNewCacheFn ¶
func WithNewCacheFn(fn NewCacheFn) EngineOption
WithNewCacheFn may be used to configure a different cache implementation. DefaultNewCacheFn is used by default.
func WithNewControllerFn ¶
func WithNewControllerFn(fn NewControllerFn) EngineOption
WithNewControllerFn may be used to configure a different controller implementation. DefaultNewControllerFn is used by default.
type NewCacheFn ¶
A NewCacheFn creates a new controller-runtime cache.
type NewControllerFn ¶
type NewControllerFn func(name string, m manager.Manager, o controller.Options) (controller.Controller, error)
A NewControllerFn creates a new controller-runtime controller.