cmd

package
v0.0.0-...-d51a932 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonMain

func DaemonMain()

DaemonMain runs controllerContext handlers.

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ParseConfiguration

func ParseConfiguration() error

ParseConfiguration set the env to AgentConfiguration

func WatchSignal

func WatchSignal(sigCh chan os.Signal)

WatchSignal notifies the signal to shut down controllerContext handlers.

Types

type Config

type Config struct {
	GoMaxProcs int

	// flags
	ConfigPath       string
	GopsListenPort   string
	PyroscopeAddress string
}

type ControllerContext

type ControllerContext struct {
	Cfg Config

	// InnerCtx is the context that can be used during shutdown.
	// It will be cancelled after receiving an interrupt or termination signal.
	InnerCtx    context.Context
	InnerCancel context.CancelFunc

	// kubernetes Clientset
	ClientSet     *kubernetes.Clientset
	DynamicClient *dynamic.DynamicClient

	CRDManager manager.Manager
	// probe
	IsStartupProbe atomic.Bool
}

func (*ControllerContext) BindControllerDaemonFlags

func (cc *ControllerContext) BindControllerDaemonFlags(flags *pflag.FlagSet)

BindControllerDaemonFlags bind controller cli daemon flags

func (*ControllerContext) LoadConfigmap

func (cc *ControllerContext) LoadConfigmap() error

LoadConfigmap reads configmap data from cli flag config-path

func (*ControllerContext) Verify

func (cc *ControllerContext) Verify()

verify after retrieve all config

Jump to

Keyboard shortcuts

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