context

package
v1.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// Controllers is the list of controllers to enable or disable
	// '*' means "all enabled by default controllers"
	// 'foo' means "enable 'foo'"
	// '-foo' means "disable 'foo'"
	// first item for a particular name wins
	Controllers []string

	Manager controllerruntime.Manager
}

Context defines the context object for controller

func (Context) IsControllerEnabled

func (c Context) IsControllerEnabled(name string, disabledByDefaultControllers sets.Set[string]) bool

IsControllerEnabled checks if the context's controllers enabled or not

type InitFunc

type InitFunc func(ctx Context) (enabled bool, err error)

InitFunc is used to launch a particular controller. Any error returned will cause the controller process to `Fatal` The bool indicates whether the controller was enabled.

type Initializers

type Initializers map[string]InitFunc

Initializers is a public map of named controller groups

func (Initializers) ControllerNames

func (i Initializers) ControllerNames() []string

ControllerNames returns all known controller names

func (Initializers) StartControllers

func (i Initializers) StartControllers(ctx Context, controllersDisabledByDefault sets.Set[string]) error

StartControllers starts a set of controllers with a specified ControllerContext

Jump to

Keyboard shortcuts

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