Documentation
¶
Overview ¶
Package operator implements a Kubernetes controller to reconcile Operator CRD resources.
Package operator implements a Kubernetes controller to reconcile Operator CRD resources.
Index ¶
- Constants
- type Controller
- type Operator
- func (op *Operator) AddController(config opv1a1.Controller) error
- func (op *Operator) GetController(name string) *dcontroller.Controller
- func (op *Operator) GetManager() runtimeMgr.Manager
- func (op *Operator) GetName() string
- func (op *Operator) GetStatus(gen int64) opv1a1.OperatorStatus
- func (op *Operator) Start(ctx context.Context) error
- func (op *Operator) Trigger(err error)
- type Options
Constants ¶
const StatusChannelBufferSize = 64
StatusChannelBufferSize defines the longest backlog on the status channel.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { runtimeManager.Runnable reconcile.Reconciler GetManager() runtimeManager.Manager }
func NewController ¶
func NewController(config *rest.Config, options runtimeManager.Options) (Controller, error)
NewController creates a new Kubernetes controller that handles the Operator CRDs.
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func New ¶
func New(name string, mgr runtimeMgr.Manager, spec *opv1a1.OperatorSpec, opts Options) *Operator
New creates a new operator.
func NewFromFile ¶
NewFromFile creates a new operator from a serialized operator spec.
func (*Operator) AddController ¶
func (op *Operator) AddController(config opv1a1.Controller) error
AddController adds a new controller to the operator.
func (*Operator) GetController ¶
func (op *Operator) GetController(name string) *dcontroller.Controller
GetController returns the controller with the given name or nil if no controller with that name exists.
func (*Operator) GetManager ¶
func (op *Operator) GetManager() runtimeMgr.Manager
GetManager returns the controller runtime manager associated with the operator.
func (*Operator) GetStatus ¶
func (op *Operator) GetStatus(gen int64) opv1a1.OperatorStatus
GetStatus populates the operator status with the controller statuses.
type Options ¶
type Options struct { // ErrorChannel is a channel to receive errors from the operator. Note that the error // channel is rate limited to at most 3 errors per every 2 seconds. Use ReportErrors on the // individual controllers to get the errors that might have been supporessed by the rate // limiter. ErrorChannel chan error // Logger is a standard logger. Logger logr.Logger }
Options can be used to customize the Operator's behavior.