operator

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func (o *Operator) GetLastAckedGeneration() int

GetLastAckedGeneration returns the last update generation acknowledged by the updater.

func (*Operator) GetLogger

func (o *Operator) GetLogger() logr.Logger

GetLogger returns the logger associated with this operator

func (*Operator) GetManager

func (o *Operator) GetManager() manager.Manager

GetManager returns the controller manager associated with this operator

func (*Operator) GetOperatorChannel

func (o *Operator) GetOperatorChannel() chan event.Event

GetOperatorChannel returns the channel on which the operator event dispatcher listens

func (*Operator) ProgressReport added in v0.18.0

func (o *Operator) ProgressReport() int

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

func (o *Operator) SetFinalizer(state bool)

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

func (o *Operator) Start(ctx context.Context, cancel context.CancelFunc) error

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.

func (*Operator) Terminate added in v0.19.0

func (o *Operator) Terminate()

Terminate completes the termination sequence of the operator.

type OperatorConfig

type OperatorConfig struct {
	Manager        manager.Manager
	ControllerName string
	RenderCh       chan event.Event
	ConfigCh       chan event.Event
	UpdaterCh      chan event.Event
	Logger         logr.Logger
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL