Documentation ¶
Overview ¶
Package builder provides a builder to build controllers.
Index ¶
- type Builder
- func (blder *Builder) Build(r creconciler.Reconciler) (ccontroller.Controller, error)
- func (blder *Builder) Complete(r creconciler.Reconciler) error
- func (blder *Builder) For(object client.Object, opts ...ForOption) *Builder
- func (blder *Builder) Named(name string) *Builder
- func (blder *Builder) Watches(src csource.Source, eventhandler handler.EventHandler, opts ...WatchesOption) *Builder
- func (blder *Builder) WithEventFilter(p cpredicate.Predicate) *Builder
- func (blder *Builder) WithOptions(options ccontroller.Options) *Builder
- type ForInput
- type ForOption
- type Predicates
- type WatchesInput
- type WatchesOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds a Controller.
func ControllerManagedBy ¶
ControllerManagedBy returns a new controller builder that will be started by the provided Manager.
func (*Builder) Build ¶
func (blder *Builder) Build(r creconciler.Reconciler) (ccontroller.Controller, error)
Build builds the Application Controller and returns the Controller it created.
func (*Builder) Complete ¶
func (blder *Builder) Complete(r creconciler.Reconciler) error
Complete builds the Application Controller.
func (*Builder) For ¶
For defines the type of Object being *reconciled*, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object*.
func (*Builder) Named ¶
Named sets the name of the controller to the given name. The name shows up in metrics, among other things, and thus should be a prometheus compatible name (underscores and alphanumeric characters only).
By default, controllers are named using the lowercase version of their kind.
func (*Builder) Watches ¶
func (blder *Builder) Watches(src csource.Source, eventhandler handler.EventHandler, opts ...WatchesOption) *Builder
Watches defines the type of Object to watch, and configures the ControllerManagedBy to respond to create / delete / update events by *reconciling the object* with the given EventHandler.
func (*Builder) WithEventFilter ¶
func (blder *Builder) WithEventFilter(p cpredicate.Predicate) *Builder
WithEventFilter sets the event filters, to filter which create/update/delete/generic events eventually trigger reconciliations. For example, filtering on whether the resource version has changed. Given predicate is added for all watched objects. Defaults to the empty list.
func (*Builder) WithOptions ¶
func (blder *Builder) WithOptions(options ccontroller.Options) *Builder
WithOptions overrides the controller options use in doController. Defaults to empty.
type ForInput ¶
type ForInput struct {
// contains filtered or unexported fields
}
ForInput represents the information set by For method.
type ForOption ¶
type ForOption interface { // ApplyToFor applies this configuration to the given for input. ApplyToFor(*ForInput) }
ForOption is some configuration that modifies options for a For request.
type Predicates ¶
type Predicates struct {
// contains filtered or unexported fields
}
Predicates filters events before enqueuing the keys.
func WithPredicates ¶
func WithPredicates(predicates ...cpredicate.Predicate) Predicates
WithPredicates sets the given predicates list.
func (Predicates) ApplyToFor ¶
func (w Predicates) ApplyToFor(opts *ForInput)
ApplyToFor applies this configuration to the given ForInput options.
func (Predicates) ApplyToWatches ¶
func (w Predicates) ApplyToWatches(opts *WatchesInput)
ApplyToWatches applies this configuration to the given WatchesInput options.
type WatchesInput ¶
type WatchesInput struct {
// contains filtered or unexported fields
}
WatchesInput represents the information set by Watches method.
type WatchesOption ¶
type WatchesOption interface { // ApplyToWatches applies this configuration to the given watches options. ApplyToWatches(*WatchesInput) }
WatchesOption is some configuration that modifies options for a watches request.