Skip to content

Commit

Permalink
smartagent extension: ensure collectd bundle dir propagates from pare…
Browse files Browse the repository at this point in the history
…nt/default
  • Loading branch information
Ryan Fitzpatrick committed Mar 18, 2021
1 parent 89c8812 commit a0c7c70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/extension/smartagentextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ func customUnmarshaller(componentViperSection *viper.Viper, intoCfg interface{})
var collectdSettings map[string]interface{}
var ok bool
if collectdSettings, ok = allSettings["collectd"].(map[string]interface{}); !ok {
// Nothing to do if user specified collectd settings do not exist.
// Defaults will be picked up.
return nil
// We must set the BundleDir field on the resulting CollectdConfig
// so we use an empty instance. Defaults will be picked up.
collectdSettings = map[string]interface{}{}
}

var collectdConfig config.CollectdConfig
Expand Down
1 change: 1 addition & 0 deletions internal/extension/smartagentextension/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestLoadConfig(t *testing.T) {
WriteServerIPAddr: "127.9.8.7",
WriteServerPort: 0,
ConfigDir: "/var/run/signalfx-agent/collectd",
BundleDir: bundleDir,
HasGenericJMXMonitor: false,
},
}
Expand Down

0 comments on commit a0c7c70

Please sign in to comment.