Fix a regression in parsing ignore.resources for traces#2797
Conversation
3d7e4f1 to
a6c5ec0
Compare
a6c5ec0 to
7106e9f
Compare
472b90d to
374d066
Compare
| expected []string | ||
| }{ | ||
| {"r1", []string{"r1"}}, | ||
| {"\"r1\",\"r2,\"", []string{"r1", "r2,"}}, |
There was a problem hiding this comment.
Nit: use back-ticks to be able to write raw strings without need for escaping
| {"r1", []string{"r1"}}, | ||
| {`"r1","r2,"`, []string{"r1", "r2,"}}, | ||
| {`"r1"`, []string{"r1"}}, | ||
| {"r1,r2", []string{"r1", "r2"}}, |
There was a problem hiding this comment.
You should probably use them for every config to stay consistent and make reading easier
| r.LazyQuotes = true | ||
| r.Comma = sep | ||
|
|
||
| record, err := r.Read() |
There was a problem hiding this comment.
Indeed, silly me. I copy pasted this from the trace-agent without giving it a thought.
|
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