commands

package
v0.0.0-...-846bdf4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultInformerResyncPeriod = 1 * time.Minute
	DefaultKubeNamespace        = corev1.NamespaceDefault
)

Defaults for root command options

Variables

View Source
var (
	ReadyChan = make(chan struct{})
)

Functions

func RunRootCommand

func RunRootCommand(ctx context.Context, agentConfig *config.AgentConfig, kubeClient kubernetes.Interface) error

func SetDefaultOpts

func SetDefaultOpts(c *Opts)

SetDefaultOpts sets default options for unset values on the passed in option struct. Fields tht are already set will not be modified.

Types

type Opts

type Opts struct {
	// Namespace is used to watch for pods and other resources.
	Namespace string
	// NodeName is used when creating a node in Kubernetes.
	NodeName string
	// KeepNodeOnExit is used to identify whether information needs to be retained in k8s
	KeepNodeOnExit bool
	// AgentConfigFile is path of agent configuration file.
	AgentConfigFile string

	APIVersion   string
	AgentVersion string
}

Opts stores all the options for configuring the root command. It is used for setting flag values.

You can set the default options by creating a new `Opts` struct and passing it into `SetDefaultOpts`

Jump to

Keyboard shortcuts

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