[Agent] Fix merge of config#17399
Conversation
|
Pinging @elastic/ingest-management (Project:fleet) |
|
tested LGTM :) |
| streams: | ||
| - enabled: true | ||
| metricset: info | ||
| hosts: ["http://apache.remote"] |
There was a problem hiding this comment.
I wonder if this is just a bad example? Because the same field should not exist in stream an input.
There was a problem hiding this comment.
yes i just needed to test override functionality somehow
There was a problem hiding this comment.
Wasn't the conclusion we don't support override? @ph ?
There was a problem hiding this comment.
@ruflin @michalpristas I think the conclusion was effectively we do not support overrides, I've looked at our email and this was the behavior he had in mind.
- for keys defined in the input section we apply them in the streams.
- for keys defined in the input section and present in the streams we fail hard.
- If a key is not defined in the inputs but defined in the stream we take the value of the stream.
There was a problem hiding this comment.
@ruflin yes we don't this test is just to make sure nothing is replaced by anything defined at inputs level so we make sure it does not happen as we copy all the fields down the tree. where we need overrride are situation when we generate somethin in tree and we want to make sure it is not lost (e.g. processors) we generate on stream level (just like index) but then we merge it with top level processors (we cannot generate at top level as fields are stream specific)
There was a problem hiding this comment.
Based on the comment from @ph , I would assume this test should fail hard? "for keys defined in the input section and present in the streams we fail hard."
There was a problem hiding this comment.
i think you're right, will make it fail entirely
|
backported in #17599 |
) * [Agent] Rename agent to elastic-agent (#17391) [Agent] Rename agent to elastic-agent (#17391) (cherry picked from commit 66609a3) * Add Elastic Agent in the Jenkinsfile (#17445) * Add Elastic Agent in the Jenkinsfile With the recent moves to Jenkins pipeline the Elastic Agent project was not currently tested. * Add Elastic Agent in the Jenkinsfile (#17445) * Add Elastic Agent in the Jenkinsfile With the recent moves to Jenkins pipeline the Elastic Agent project was not currently tested. * [Agent] Fix merge of config (#17399) [Agent] Fix merge of config #17399 * [Agent] Handle abs paths on windows correctly (#17461) * handle windows correctly * Missing commits from the initial merges of the agent -> master Co-authored-by: Michal Pristas <michal.pristas@gmail.com> Co-authored-by: Pier-Hugues Pellerin <phpellerin@gmail.com>
What does this PR do?
Copies every field from input to streams on input creation. Before this change only processors were copied.
Why is it important?
To allow specifying hosts or vars as a common configuration parts for input streams
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Fixes: #17377