Skip to content

Commit

Permalink
rename configMissingOK field to baseConfigMissingOK
Browse files Browse the repository at this point in the history
  • Loading branch information
modernplumbing committed Dec 26, 2022
1 parent 6c79587 commit 9fcc695
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion comp/core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newConfig(deps dependencies) (Component, error) {
deps.Params.confFilePath,
deps.Params.configName,
!deps.Params.configLoadSecrets,
!deps.Params.configMissingOK,
!deps.Params.baseConfigMissingOK,
deps.Params.defaultConfPath)
if err != nil {
return nil, err
Expand Down
11 changes: 6 additions & 5 deletions comp/core/config/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Params struct {
// the component's config data.
configLoadSysProbe bool

// securityAgentConfigFilePaths are the paths at which to look for security-aegnt
// securityAgentConfigFilePaths are the paths at which to look for security-agent
// configuration, usually given by the --cfgpath command-line flag.
securityAgentConfigFilePaths []string

Expand All @@ -40,9 +40,9 @@ type Params struct {
// should be evaluated. This is typically false for one-shot commands.
configLoadSecrets bool

// configMissingOK determines whether it is a fatal error if the config
// baseConfigMissingOK determines whether it is a fatal error if the base Datadog config
// file does not exist.
configMissingOK bool
baseConfigMissingOK bool

// defaultConfPath determines the default configuration path.
// if defaultConfPath is empty, then no default configuration path is used.
Expand Down Expand Up @@ -82,6 +82,7 @@ func NewSecurityAgentParams(securityAgentConfigFilePaths []string, options ...fu
params := NewParams("", options...)
params.securityAgentConfigFilePaths = securityAgentConfigFilePaths
params.configLoadSecurityAgent = true
params.baseConfigMissingOK = true
return params
}

Expand All @@ -93,7 +94,7 @@ func WithConfigName(name string) func(*Params) {

func WithConfigMissingOK(v bool) func(*Params) {
return func(b *Params) {
b.configMissingOK = v
b.baseConfigMissingOK = v
}
}

Expand Down Expand Up @@ -144,7 +145,7 @@ func (p Params) ConfigLoadSecrets() bool {
// ConfigMissingOK determines whether it is a fatal error if the config
// file does not exist.
func (p Params) ConfigMissingOK() bool {
return p.configMissingOK
return p.baseConfigMissingOK
}

// ConfigLoadSysProbe determines whether to read the system-probe.yaml into
Expand Down

0 comments on commit 9fcc695

Please sign in to comment.