controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToManager

func AddToManager(manager ctrl.Manager, spec *Spec) error

AddToManager adds a new controller to the given manager.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is a wrapper of a k8s controller manager.

func NewManager

func NewManager(manager ctrl.Manager) *Manager

NewManager returns a new manager.

func (*Manager) GracefulStop

func (m *Manager) GracefulStop() error

GracefulStop does a graceful stop of the manager.

func (*Manager) Name

func (m *Manager) Name() string

Name of the manager.

func (*Manager) Start

func (m *Manager) Start() error

Start the manager.

func (*Manager) Stop

func (m *Manager) Stop() error

Stop the manager.

type Spec

type Spec struct {
	// Name of the controller
	Name string
	// Object being watched.
	Object client.Object
	// AddHandler handles object create/update.
	AddHandler func(ctx context.Context, object any) error
	// DeleteHandler handles object deletes.
	DeleteHandler func(ctx context.Context, name types.NamespacedName) error
}

Spec holds everything needed to create a controller.

Jump to

Keyboard shortcuts

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