config

package module
v0.56.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 16

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

View Source
const (
	// DefaultConfPath points to the folder containing datadog.yaml
	DefaultConfPath = "/etc/datadog-agent"
)

Variables

This section is empty.

Functions

func Module

func Module() fxutil.Module

Module defines the fx options for this component.

func WithConfFilePath

func WithConfFilePath(confFilePath string) func(*Params)

WithConfFilePath returns an option which sets ConfFilePath

func WithConfigLoadSecurityAgent

func WithConfigLoadSecurityAgent(configLoadSecurityAgent bool) func(*Params)

WithConfigLoadSecurityAgent returns an option which sets configLoadSecurityAgent

func WithConfigMissingOK

func WithConfigMissingOK(v bool) func(*Params)

WithConfigMissingOK returns an option which sets configMissingOK

func WithConfigName

func WithConfigName(name string) func(*Params)

WithConfigName returns an option which sets the config name

func WithExtraConfFiles added in v0.56.0

func WithExtraConfFiles(extraConfFilePath []string) func(*Params)

WithExtraConfFiles returns an option which sets ConfFilePath

func WithIgnoreErrors

func WithIgnoreErrors(v bool) func(*Params)

WithIgnoreErrors returns an option which sets ignoreErrors

func WithSecurityAgentConfigFilePaths

func WithSecurityAgentConfigFilePaths(securityAgentConfigFilePaths []string) func(*Params)

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

func NewServerlessConfig(path string) (Component, error)

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 LogConfig

type LogConfig pkgconfigmodel.Reader

LogConfig reads the logger config

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

func NewAgentParams(confFilePath string, options ...func(*Params)) Params

NewAgentParams creates a new instance of Params for the Agent.

func NewClusterAgentParams

func NewClusterAgentParams(configFilePath string, options ...func(*Params)) Params

NewClusterAgentParams returns a new Params struct for the cluster agent

func NewParams

func NewParams(defaultConfPath string, options ...func(*Params)) Params

NewParams creates a new instance of Params

func NewSecurityAgentParams

func NewSecurityAgentParams(securityAgentConfigFilePaths []string, options ...func(*Params)) Params

NewSecurityAgentParams creates a new instance of Params for the Security Agent.

func (Params) ConfigMissingOK

func (p Params) ConfigMissingOK() bool

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

Jump to

Keyboard shortcuts

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