Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for tags in the config not being applied to the agent. #308

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down