Fix for tags in the config not being applied to the agent.
This commit is contained in:
parent
c8852339c9
commit
8230b7d7bc
|
@ -21,7 +21,7 @@ import (
|
|||
// specified
|
||||
type Config struct {
|
||||
// This lives outside the agent because mergeStruct doesn't need to handle maps normally.
|
||||
// We just copy the elements manually in applyAgent.
|
||||
// We just copy the elements manually in ApplyAgent.
|
||||
Tags map[string]string
|
||||
|
||||
agent *Agent
|
||||
|
@ -129,11 +129,11 @@ func (c *Config) ApplyOutput(name string, v interface{}) error {
|
|||
// Overrides only values in the given struct that were set in the config.
|
||||
func (c *Config) ApplyAgent(a *Agent) error {
|
||||
if c.agent != nil {
|
||||
for key, value := range c.Tags {
|
||||
a.Tags[key] = value
|
||||
}
|
||||
return mergeStruct(a, c.agent, c.agentFieldsSet)
|
||||
}
|
||||
for key, value := range c.Tags {
|
||||
a.Tags[key] = value
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -142,7 +142,6 @@ func (s *MergeStructSuite) TestFullMerge() {
|
|||
s.T().Error(err)
|
||||
}
|
||||
s.Equal(result, s.FullStruct, fmt.Sprintf("Full merge of %v onto FullStruct failed.", s.AnotherFullStruct))
|
||||
s.T().Log("hi")
|
||||
}
|
||||
|
||||
func (s *MergeStructSuite) TestPartialMergeWithoutSlices() {
|
||||
|
|
Loading…
Reference in New Issue