You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to override any field from agent.download in elastic-agent.yml, the values from the configuration file are simply ignored. That makes the DownloadConfig struct from configuration.SettingsConfig never accepting any values other than the default ones.
I did a bit of digging and it seems to be related to the httpcommon.HTTPTransportSettings struct embedded into artifact.Config:
httpcommon.HTTPTransportSettings`config:",inline" yaml:",inline"`// Note: use anonymous struct for json inline
.
I managed to reproduce it by creating a new struct with httpcommon.HTTPTransportSettings embedded and with the same struct tags, then I experienced the same bug.
Here is an example on how to reproduce it:
In internal/pkg/agent/configuration/settings.go edit SettingsConfig to have a new field:
It will be empty (all zero values) even though cfg contains the correct values.
Removing the embedded httpcommon.HTTPTransportSettings fix the problem. However it is not feasible for the original Elastic-Agent configuration.
The bug is likely on github.com/elastic/go-ucfg, I'm reporting it here because it's affecting the Elastic-Agent and that's the way I managed to reproduce it. Also if somebody else faces this configuration issue, it's documented here.
The text was updated successfully, but these errors were encountered:
When trying to override any field from
agent.download
inelastic-agent.yml
, the values from the configuration file are simply ignored. That makes theDownloadConfig
struct fromconfiguration.SettingsConfig
never accepting any values other than the default ones.I did a bit of digging and it seems to be related to the
httpcommon.HTTPTransportSettings
struct embedded intoartifact.Config
:elastic-agent/internal/pkg/artifact/config.go
Line 46 in 552a87d
I managed to reproduce it by creating a new struct with
httpcommon.HTTPTransportSettings
embedded and with the same struct tags, then I experienced the same bug.Here is an example on how to reproduce it:
internal/pkg/agent/configuration/settings.go
editSettingsConfig
to have a new field:elastic-agent.yml
adding something like:SettingsConfig.FooConfig
right after the yaml file parsed and merged with the default config here:elastic-agent/internal/pkg/agent/configuration/configuration.go
Line 32 in 552a87d
It will be empty (all zero values) even though
cfg
contains the correct values.httpcommon.HTTPTransportSettings
fix the problem. However it is not feasible for the original Elastic-Agent configuration.The bug is likely on github.com/elastic/go-ucfg, I'm reporting it here because it's affecting the Elastic-Agent and that's the way I managed to reproduce it. Also if somebody else faces this configuration issue, it's documented here.
The text was updated successfully, but these errors were encountered: