mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Dont fail config if agent opts is nil (#1898)
* Handle agentopts nil better * Add changes file
This commit is contained in:
parent
36971b4cb8
commit
15ce06263d
2 changed files with 8 additions and 4 deletions
1
changes/dont-fail-config-agent-opts-nil
Normal file
1
changes/dont-fail-config-agent-opts-nil
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Handle properly the case where the agent opts is nil in the app config.
|
||||
|
|
@ -224,10 +224,13 @@ func (svc *Service) GetClientConfig(ctx context.Context) (map[string]interface{}
|
|||
return nil, osqueryError{message: "internal error: fetch base config: " + err.Error()}
|
||||
}
|
||||
|
||||
var config map[string]interface{}
|
||||
err = json.Unmarshal(baseConfig, &config)
|
||||
if err != nil {
|
||||
return nil, osqueryError{message: "internal error: parse base configuration: " + err.Error()}
|
||||
config := make(map[string]interface{})
|
||||
|
||||
if baseConfig != nil {
|
||||
err = json.Unmarshal(baseConfig, &config)
|
||||
if err != nil {
|
||||
return nil, osqueryError{message: "internal error: parse base configuration: " + err.Error()}
|
||||
}
|
||||
}
|
||||
|
||||
packs, err := svc.ds.ListPacksForHost(host.ID)
|
||||
|
|
|
|||
Loading…
Reference in a new issue