Documentation ¶
Overview ¶
Package command implements the top-level `process-agent` binary, including its subcommands.
Index ¶
- Constants
- Variables
- func FixDeprecatedFlags(args []string, w io.Writer) []string
- func GetCoreBundleParamsForOneShot(globalParams *GlobalParams) core.BundleParams
- func MakeCommand(subcommandFactories []SubcommandFactory, winParams bool, ...) *cobra.Command
- func RootCmdRun(globalParams *GlobalParams)
- func SetHostMountEnv(logger log.Component)
- type GlobalParams
- type SubcommandFactory
- type WinParams
Constants ¶
const LoggerName pkglogsetup.LoggerName = "PROCESS"
const UseWinParams = false
UseWinParams is set to true when ran on Windows
Variables ¶
var DaemonLogParams = log.ForDaemon(string(LoggerName), "process_config.log_file", pkgconfigsetup.DefaultProcessAgentLogFile)
DaemonLogParams are the log params should be given to the `core.BundleParams` for when the process agent is running as a daemon
var OneShotLogParams = log.ForOneShot(string(LoggerName), "info", true)
OneShotLogParams are the log params that are given to commands
Functions ¶
func FixDeprecatedFlags ¶
FixDeprecatedFlags transforms args so that they are conforming to the new CLI structure: - replace non-posix flags posix flags - replace deprecated flags with their command equivalents - display warnings when deprecated flags are encountered
func GetCoreBundleParamsForOneShot ¶
func GetCoreBundleParamsForOneShot(globalParams *GlobalParams) core.BundleParams
func MakeCommand ¶
func MakeCommand(subcommandFactories []SubcommandFactory, winParams bool, rootCmdRun func(globalParams *GlobalParams)) *cobra.Command
MakeCommand makes the top-level Cobra command for this app.
func RootCmdRun ¶
func RootCmdRun(globalParams *GlobalParams)
RootCmdRun is the main function to run the process agent
func SetHostMountEnv ¶
SetHostMountEnv sets HOST_PROC and HOST_SYS mounts if applicable in containerized environments
Types ¶
type GlobalParams ¶
type GlobalParams struct { // ConfFilePath holds the path to the folder containing the configuration // file, to allow overrides from the command line ConfFilePath string // ExtraConfFilePath represents the paths to additional configuration files. ExtraConfFilePath []string // SysProbeConfFilePath holds the path to the folder containing the system-probe // configuration file, to allow overrides from the command line SysProbeConfFilePath string // FleetPoliciesDirPath holds the path to the folder containing the fleet policies FleetPoliciesDirPath string // PidFilePath specifies the path to the pid file PidFilePath string // WinParams provides windows specific options WinParams WinParams // NoColor is a flag to disable color output NoColor bool }
GlobalParams contains the values of agent-global Cobra flags.
A pointer to this type is passed to SubcommandFactory's, but its contents are not valid until Cobra calls the subcommand's Run or RunE function.
type SubcommandFactory ¶
type SubcommandFactory func(globalParams *GlobalParams) []*cobra.Command
SubcommandFactory is a callable that will return a slice of subcommands.