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

[Fleet] Remove escaping numeric value in agent template #114123

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Oct 6, 2021

Summary

Resolve #112896

Context

To go from a package policy to the agent policy as it's going to be send to the agent we used YAML handlebar template defined in the package where we inject variables configured by the user, to be able to handle most of the case we have some custom logic on how we populate this template.

Description

We introduced escaping the text variable, if it's a numerical value when we compile the agent template, this seems to be problematic as it does not allow string interpolation.

That PR remove that, for the integration that really need the yaml to be string, I think the best solution will be to use the !!str keyword in the agent template.

@elastic/integrations I would love to have your thoughts on that as it is a breaking change, from what I know the only integration impacted by that will be osquery but they already stopped to use agent template for 7.16.0.

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 6, 2021
@nchaulet nchaulet requested a review from a team as a code owner October 6, 2021 15:12
@nchaulet nchaulet self-assigned this Oct 6, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet requested a review from jen-huang October 6, 2021 15:17
@nchaulet
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, since we're mostly just removing code and allowing for the !!str escape hatch. 🚀

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

@nchaulet nchaulet merged commit 065b42b into elastic:master Oct 14, 2021
@nchaulet nchaulet deleted the fix-112896-agent-template-should-not-escape-string branch October 14, 2021 19:28
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 14, 2021
…15086)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Invalid agent YAML is generated when quoted text fields are numeric
4 participants