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 ESSOptions ¶
ESSOptions for External Secret Stores.
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.
type Options ¶
type Options struct { // The Logger controllers should use. Logger logging.Logger // The GlobalRateLimiter used by this controller manager. The rate of // reconciles across all controllers will be subject to this limit. GlobalRateLimiter workqueue.RateLimiter // PollInterval at which each controller should speculatively poll to // determine whether it has work to do. PollInterval time.Duration // MaxConcurrentReconciles for each controller. MaxConcurrentReconciles int // Features that should be enabled. Features *feature.Flags // ESSOptions for External Secret Stores. ESSOptions *ESSOptions }
Options frequently used by most Crossplane controllers.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns a functional set of options with conservative defaults.
func (Options) ForControllerRuntime ¶
func (o Options) ForControllerRuntime() controller.Options
ForControllerRuntime extracts options for controller-runtime.