Documentation ¶
Overview ¶
Package config implements a component to handle agent configuration. This component temporarily wraps pkg/config.
This component initializes pkg/config based on the bundle params, and will return the same results as that package. This is to support migration to a component architecture. When no code still uses pkg/config, that package will be removed.
The mock component does nothing at startup, beginning with an empty config. It also overwrites the pkg/config.Datadog for the duration of the test.
Index ¶
- Constants
- func Module() fxutil.Module
- func WithConfFilePath(confFilePath string) func(*Params)
- func WithConfigLoadSecurityAgent(configLoadSecurityAgent bool) func(*Params)
- func WithConfigMissingOK(v bool) func(*Params)
- func WithConfigName(name string) func(*Params)
- func WithExtraConfFiles(extraConfFilePath []string) func(*Params)
- func WithIgnoreErrors(v bool) func(*Params)
- func WithSecurityAgentConfigFilePaths(securityAgentConfigFilePaths []string) func(*Params)
- type Component
- type LogConfig
- type Params
- func NewAgentParams(confFilePath string, options ...func(*Params)) Params
- func NewClusterAgentParams(configFilePath string, options ...func(*Params)) Params
- func NewParams(defaultConfPath string, options ...func(*Params)) Params
- func NewSecurityAgentParams(securityAgentConfigFilePaths []string, options ...func(*Params)) Params
- type Reader
Constants ¶
const (
// DefaultConfPath points to the folder containing datadog.yaml
DefaultConfPath = "/etc/datadog-agent"
)
Variables ¶
This section is empty.
Functions ¶
func WithConfFilePath ¶
WithConfFilePath returns an option which sets ConfFilePath
func WithConfigLoadSecurityAgent ¶
WithConfigLoadSecurityAgent returns an option which sets configLoadSecurityAgent
func WithConfigMissingOK ¶
WithConfigMissingOK returns an option which sets configMissingOK
func WithConfigName ¶
WithConfigName returns an option which sets the config name
func WithExtraConfFiles ¶ added in v0.56.0
WithExtraConfFiles returns an option which sets ConfFilePath
func WithIgnoreErrors ¶
WithIgnoreErrors returns an option which sets ignoreErrors
func WithSecurityAgentConfigFilePaths ¶
WithSecurityAgentConfigFilePaths returns an option which sets securityAgentConfigFilePaths
Types ¶
type Component ¶
type Component interface { pkgconfigmodel.ReaderWriter // Warnings returns config warnings collected during setup. Warnings() *pkgconfigmodel.Warnings }
Component is the component type.
func NewServerlessConfig ¶
NewServerlessConfig initializes a config component from the given config file TODO: serverless must be eventually migrated to fx, this workaround will then become obsolete - ts should not be created directly in this fashion.
type Params ¶
type Params struct { // ConfFilePath is the path at which to look for configuration, usually // given by the --cfgpath command-line flag. ConfFilePath string // ExtraConfFilePath represents the paths to additional configuration files to be merged over the main datadog.yaml. // Usually given by the --extracfgpath command-line flag. ExtraConfFilePath []string // contains filtered or unexported fields }
Params defines the parameters for the config component.
func NewAgentParams ¶
NewAgentParams creates a new instance of Params for the Agent.
func NewClusterAgentParams ¶
NewClusterAgentParams returns a new Params struct for the cluster agent
func NewSecurityAgentParams ¶
NewSecurityAgentParams creates a new instance of Params for the Security Agent.
func (Params) ConfigMissingOK ¶
ConfigMissingOK determines whether it is a fatal error if the config file does not exist.
type Reader ¶
type Reader = pkgconfigmodel.Reader //nolint:revive
Reader is a subset of Config that only allows reading of configuration