-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[7.17] (backport elastic-agent#680) Fix transpiler to allow : in dynamic variables. #32407
[7.17] (backport elastic-agent#680) Fix transpiler to allow : in dynamic variables. #32407
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
@michel-laterman I believe it'd be better for the same reviewers of the original PR (elastic/elastic-agent#680) to review this backport. |
@@ -15,7 +15,7 @@ import ( | |||
"github.com/elastic/beats/v7/libbeat/common" | |||
) | |||
|
|||
var varsRegex = regexp.MustCompile(`\${([\p{L}\d\s\\\-_|.'"]*)}`) | |||
var varsRegex = regexp.MustCompile(`\${([\p{L}\d\s\\\-_|.'":]*)}`) |
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.
Small comment here, this mean the following variable declaration would be valid:
${dynami:c.lookup|'fallback.here'}
dynami:c.lookup
seems weird to me, but again... this is still a valid key reference in YAML if you quote the key value.
'test:ok': hello
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.
yeah! yaml? 😕
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.
I had yaml with a passion, not sure it was better than xml ;)
This pull request is now in conflicts. Could you fix it? 🙏
|
Backport elastic/elastic-agent#680
Fix transpiler regex to allow ':' characters in dynamic variables so
that users can input "${dynamic.lookup|'fallback.here'}".