-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 a regression in parsing ignore.resources for traces #2797
Fix a regression in parsing ignore.resources for traces #2797
Conversation
3d7e4f1
to
a6c5ec0
Compare
a6c5ec0
to
7106e9f
Compare
472b90d
to
374d066
Compare
pkg/config/legacy/converter_test.go
Outdated
expected []string | ||
}{ | ||
{"r1", []string{"r1"}}, | ||
{"\"r1\",\"r2,\"", []string{"r1", "r2,"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use back-ticks to be able to write raw strings without need for escaping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, apart from them, looks good to me
pkg/config/legacy/converter_test.go
Outdated
{"r1", []string{"r1"}}, | ||
{`"r1","r2,"`, []string{"r1", "r2,"}}, | ||
{`"r1"`, []string{"r1"}}, | ||
{"r1,r2", []string{"r1", "r2"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably use them for every config to stay consistent and make reading easier
pkg/config/legacy/converter.go
Outdated
r.LazyQuotes = true | ||
r.Comma = sep | ||
|
||
record, err := r.Read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you just return r.Read() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, silly me. I copy pasted this from the trace-agent
without giving it a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - For anyone looking at this PR and seeing the critical
label: there is no impact on the version 6 of the agent. This code is shared with the datadog-trace-agent and impacts the version 5 of the agent.
Note: this PR has a small impact on Agent 6, since it affects the |
The bug indeed breaks the |
Let's add a bugfix release note to this PR then |
Codecov Report
@@ Coverage Diff @@
## master #2797 +/- ##
==========================================
+ Coverage 57.13% 57.14% +<.01%
==========================================
Files 385 383 -2
Lines 24746 24644 -102
==========================================
- Hits 14139 14082 -57
+ Misses 9671 9634 -37
+ Partials 936 928 -8
|
What does this PR do?
This PR addresses a regression in the parsing of the ini configuration for the trace agent introduced in #2698.
It used to accept strings normal strings, but now requires them to be escaped with quotes. Meaning that:
used to work but is now broken. And given the ini parser strips quotes, the only way I've found to parse a single resource is to do:
It currently works for multiple resources with the format:
But this is not backward compatible with the previous version that was:
Motivation
This PR reverts the original behavior to avoid having a non backward compatible change.
Additional Notes