Documentation
¶
Index ¶
- type Operator
- func (o *Operator) Finalize()
- func (o *Operator) GetLastAckedGeneration() int
- func (o *Operator) GetLogger() logr.Logger
- func (o *Operator) GetManager() manager.Manager
- func (o *Operator) GetOperatorChannel() chan event.Event
- func (o *Operator) ProgressReport() int
- func (o *Operator) SetFinalizer(state bool)
- func (o *Operator) SetProgressReporters(reporters ...config.ProgressReporter)
- func (o *Operator) Stabilize()
- func (o *Operator) Start(ctx context.Context, cancel context.CancelFunc) error
- func (o *Operator) Terminate()
- type OperatorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func NewOperator ¶
func NewOperator(cfg OperatorConfig) *Operator
NewOperator creates a new Operator
func (*Operator) Finalize ¶ added in v0.19.0
func (o *Operator) Finalize()
Finalize invalidates the status on all the managed resources. Note that Finalize must be called with the main even loop blocked.
func (*Operator) GetLastAckedGeneration ¶ added in v0.19.0
GetLastAckedGeneration returns the last update generation acknowledged by the updater.
func (*Operator) GetManager ¶
GetManager returns the controller manager associated with this operator
func (*Operator) GetOperatorChannel ¶
GetOperatorChannel returns the channel on which the operator event dispatcher listens
func (*Operator) ProgressReport ¶ added in v0.18.0
ProgressReport returns the number of ongoing operations (rendering processes, updates, etc) plus the number of throttled rendering processes in progress.
func (*Operator) SetFinalizer ¶ added in v0.19.0
SetFinalizer can be used to prevent the finalizer from running on termination. This is useful for testing.
func (*Operator) SetProgressReporters ¶ added in v0.18.0
func (o *Operator) SetProgressReporters(reporters ...config.ProgressReporter)
SetProgressReporters sets the operator subsystems that need to be queried to check the number of operations in progrses. This can be used to implement graceful shutdown.
func (*Operator) Stabilize ¶ added in v0.19.0
func (o *Operator) Stabilize()
Stabilize waits until all internal progress has stopped by checking if there's no activity 3 times.
func (*Operator) Start ¶
Start spawns the Kubernetes controllers, enters the operator main loop and terminates when the provided context is canceled. On termination, Start calls the provided cancel function (if not nil) to signal that it has finished running. Pass in the manager context as the second argument to let the operator automatically cancel the manager on termination.