diff --git a/pkg/config/config.go b/pkg/config/config.go index 005a7a015..7e86ab833 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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...) diff --git a/pkg/plugins/plugins_linux.go b/pkg/plugins/plugins_linux.go index fc8e57e3f..b349aa027 100644 --- a/pkg/plugins/plugins_linux.go +++ b/pkg/plugins/plugins_linux.go @@ -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)) } @@ -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())) diff --git a/pkg/plugins/plugins_windows.go b/pkg/plugins/plugins_windows.go index 07630ae9e..afb1464c9 100644 --- a/pkg/plugins/plugins_windows.go +++ b/pkg/plugins/plugins_windows.go @@ -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 } @@ -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)