context

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 8 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 {
	Context           context.Context
	Mgr               controllerruntime.Manager
	CloudProvider     multiclusterprovider.Interface
	Opts              Options
	DynamicClientSet  dynamic.Interface
	InformerManager   genericmanager.SingleClusterInformerManager
	ProviderClassName string
}

Context defines the context object for controller.

func (Context) IsControllerEnabled

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

IsControllerEnabled check if a specified controller 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

type Options

type Options struct {
	// Controllers contains all controller names.
	Controllers []string
	// RateLimiterOptions contains the options for rate limiter.
	RateLimiterOptions ratelimiterflag.Options
}

Options defines all the parameters required by our controllers.

Jump to

Keyboard shortcuts

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