[Ingest Manager] Add contains handlebar helper for conditional blocks in yaml#72698
[Ingest Manager] Add contains handlebar helper for conditional blocks in yaml#72698andrewstucki merged 6 commits intoelastic:masterfrom
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
nchaulet
left a comment
There was a problem hiding this comment.
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
inListgo template helper.Checklist