factory

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 27 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerCommandConfig

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

ControllerCommandConfig holds values required to construct a command to run.

func NewControllerCommandConfig

func NewControllerCommandConfig(componentName string, version version.Info, startFunc StartFunc) *ControllerCommandConfig

NewControllerConfig returns a new ControllerCommandConfig which can be used to wire up all the boiler plate of a controller TODO add more methods around wiring health checks and the like

func (*ControllerCommandConfig) NewCommand

func (c *ControllerCommandConfig) NewCommand() *cobra.Command

func (*ControllerCommandConfig) StartController

func (c *ControllerCommandConfig) StartController(ctx context.Context) error

StartController runs the controller. This is the recommend entrypoint when you don't need to customize the builder.

func (*ControllerCommandConfig) WithHealthChecks

func (c *ControllerCommandConfig) WithHealthChecks(healthChecks ...healthz.HealthChecker) *ControllerCommandConfig

type ControllerFlags

type ControllerFlags struct {
	// KubeConfigFile points to a kubeconfig file if you don't want to use the in cluster config
	KubeConfigFile string
	// EnableLeaderElection enables the leader election for the controller
	EnableLeaderElection bool
	// ComponentNamespace is the namespace to run component
	ComponentNamespace string
}

ControllerFlags provides the "normal" controller flags

func NewControllerFlags

func NewControllerFlags() *ControllerFlags

NewControllerFlags returns flags with default values set

func (*ControllerFlags) AddFlags

func (f *ControllerFlags) AddFlags(cmd *cobra.Command)

AddFlags register and binds the default flags

type StartFunc

type StartFunc func(context.Context, *rest.Config) error

StartFunc is the function to call on leader election start

Jump to

Keyboard shortcuts

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