Documentation
¶
Index ¶
- Constants
- func NewErrorReporter(errorChan chan error) *errorReporter
- type Controller
- func (c *Controller) GetName() string
- func (c *Controller) GetStatus(gen int64) opv1a1.ControllerStatus
- func (c *Controller) GetWatcher() chan reconciler.Request
- func (s Controller) IsCritical() bool
- func (s Controller) IsEmpty() bool
- func (s Controller) Pop()
- func (s Controller) Push(err error, critical bool) error
- func (s Controller) PushCriticalError(err error) error
- func (s Controller) PushError(err error) error
- func (s Controller) Report() []string
- func (c *Controller) ReportErrors() []string
- func (c *Controller) SetPipeline(pipeline pipeline.Evaluator)
- func (s Controller) Size() int
- func (c *Controller) Start(ctx context.Context) error
- func (s Controller) String() string
- func (s Controller) Top() error
- type ControllerReconciler
- type Options
- type ProcessorFunc
Constants ¶
const ( // ErrorReporterStackSize controls the depth of the LIFO error buffer. ErrorReporterStackSize int = 10 // TrimPrefixSuffixLen contols the number of characters to retain at the prefix and the // suffix of long strings. TrimPrefixSuffixLen = 120 )
const WatcherBufferSize int = 1024
Variables ¶
This section is empty.
Functions ¶
func NewErrorReporter ¶
func NewErrorReporter(errorChan chan error) *errorReporter
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is a dcontroller reconciler.
func New ¶
func New(mgr runtimeManager.Manager, config opv1a1.Controller, opts Options) (*Controller, error)
New registers a new controller given by the source resource(s) the controller watches, a target resource the controller sends its output, and a processing pipeline to process the base resources into target resources.
func (*Controller) GetName ¶
func (c *Controller) GetName() string
GetName returns the name of the controller.
func (*Controller) GetStatus ¶
func (c *Controller) GetStatus(gen int64) opv1a1.ControllerStatus
func (*Controller) GetWatcher ¶
func (c *Controller) GetWatcher() chan reconciler.Request
GetWatcher returns the channel that multiplexes the requests coming from the base resources.
func (Controller) IsCritical ¶
func (s Controller) IsCritical() bool
func (Controller) PushCriticalError ¶
func (*Controller) ReportErrors ¶
func (c *Controller) ReportErrors() []string
ReportErrors returns a short report on the error stack of the controller.
func (*Controller) SetPipeline ¶
func (c *Controller) SetPipeline(pipeline pipeline.Evaluator)
SetPipeline overrides the pipeline of the controller. Useful for adding a custom pipeline to a controller.
type ControllerReconciler ¶
type ControllerReconciler struct {
// contains filtered or unexported fields
}
ControllerReconciler is a generic reconciler that feeds the requests received from any of the sources into the controller processor pipeline.
func NewControllerReconciler ¶
func NewControllerReconciler(mgr runtimeManager.Manager, c *Controller) *ControllerReconciler
func (*ControllerReconciler) Reconcile ¶
func (r *ControllerReconciler) Reconcile(ctx context.Context, req reconciler.Request) (reconcile.Result, error)
type Options ¶
type Options struct { // Processor allows to override the default request processor of the controller. Processor ProcessorFunc // ErrorChannel is a channel to receive errors from the controller. ErrorChan chan error }
type ProcessorFunc ¶
type ProcessorFunc func(ctx context.Context, c *Controller, req reconciler.Request) error