Skip to content

Commit

Permalink
fix: removed custom attributes send heartbeat when running in forward…
Browse files Browse the repository at this point in the history
…er mode
  • Loading branch information
brushknight authored and carlosroman committed Jul 23, 2020
1 parent 6503df0 commit 08b4cc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,10 @@ func NormalizeConfig(cfg *Config, cfgMetadata config_loader.YAMLMetadata) (err e

cfg.IsForwardOnly = cfg.IsForwardOnly || cfg.K8sIntegration

if cfg.IsForwardOnly {
cfg.ConnectEnabled = false
}

// For backwards compatibility FileDevicesBlacklist is deprecated.
if len(cfg.FileDevicesBlacklist) > 0 {
cfg.FileDevicesIgnored = append(cfg.FileDevicesIgnored, cfg.FileDevicesBlacklist...)
Expand Down
5 changes: 2 additions & 3 deletions pkg/plugins/plugins_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ func RegisterPlugins(agent *agnt.Agent) error {
agent.DeprecatePlugin(ids.PluginID{"services", "sysv_init"})
agent.DeprecatePlugin(ids.PluginID{"services", "docker"})

agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))

if config.K8sIntegration {
agent.RegisterPlugin(NewK8sIntegrationsPlugin(agent.Context, agent.Plugins))
}
Expand All @@ -46,10 +44,11 @@ func RegisterPlugins(agent *agnt.Agent) error {
}

if config.IsForwardOnly {
registerForwarderHeartbeat(agent)
return nil
}

agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))

// Enabling the hostinfo plugin will make the host appear in the UI
agent.RegisterPlugin(pluginsLinux.NewHostinfoPlugin(agent.Context, agent.GetCloudHarvester()))
agent.RegisterPlugin(NewHostAliasesPlugin(agent.Context, agent.GetCloudHarvester()))
Expand Down
4 changes: 2 additions & 2 deletions pkg/plugins/plugins_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
func RegisterPlugins(agent *agnt.Agent) error {
config := agent.GetContext().Config()

agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))

if config.IsForwardOnly {
return nil
}
Expand All @@ -31,6 +29,8 @@ func RegisterPlugins(agent *agnt.Agent) error {
agent.RegisterPlugin(proxy.ConfigPlugin(agent.Context))
}

agent.RegisterPlugin(NewCustomAttrsPlugin(agent.Context))

if config.IsSecureForwardOnly {
// We need heartbeat samples.
sender := metricsSender.NewSender(agent.Context)
Expand Down

0 comments on commit 08b4cc5

Please sign in to comment.