-
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
[Agent] Fix merge of config #17399
[Agent] Fix merge of config #17399
Conversation
Pinging @elastic/ingest-management (Project:fleet) |
tested LGTM :) |
- namespace: testing | ||
use_output: default | ||
inputs: | ||
- type: apache/metrics | ||
streams: | ||
- enabled: true | ||
metricset: info | ||
hosts: ["http://apache.remote"] |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i just needed to test override functionality somehow
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.
Wasn't the conclusion we don't support override? @ph ?
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you're right, will make it fail entirely
backported in #17599 |
[Agent] Fix merge of config elastic#17399
) * [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.asciidoc
orCHANGELOG-developer.next.asciidoc
.Fixes: #17377