-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Ingest Manager] Add contains handlebar helper for conditional blocks in yaml #72698
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
x-pack/plugins/ingest_manager/server/services/epm/agent/agent.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ingest_manager/server/services/epm/agent/agent.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ingest_manager/server/services/epm/agent/agent.ts
Outdated
Show resolved
Hide resolved
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 small comment otherwise 👍
Do we need this in 7.9?
Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com>
@nchaulet I'm assuming it would probably make the ingest package conversion a bit easier if this was in sooner than later, but I'm assuming if this was in master we could pick it up for developing packages via nightly snapshot builds? @andrewkroh any thoughts? |
@elasticmachine merge upstream |
@jen-huang @nchaulet agree on 7.10. |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
… in yaml (#72698) (#73131) * Add contains handlebar helper for conditionally adding blocks in ingest manager yaml * Split into two tests and sandbox handlebars runtime * Make helper a little bit more robust and the any explicit * Add this to function signature with explicit any type * Update x-pack/plugins/ingest_manager/server/services/epm/agent/agent.ts Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com> Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Every addition to handlebar should also be documented in the future on the package side so someone building a package understands which helpers can be used and how they work. I expect us in the future to also do some handlebars validation on the registry side and then we must be able to implement the same handlers. @andrewstucki Could you add an issue on the package-registry side for this? |
Summary
So, beats have some use cases in current filebeat modules that change configuration depending on certain tags being included. For example:
https://github.com/elastic/beats/blob/bca0adcd4353d2a547e73cb9523a456971d9dc27/x-pack/filebeat/module/crowdstrike/falcon/config/falcon.yml#L16
This handlebars helper would basically allow us to have the same sort of conditional block inclusion based off of whether certain things were members of an array, i.e. it's the handlebars equivalent of the
inList
go template helper.Checklist