-
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
Check modules and prospectors settings when reload is off #5053
Conversation
594c148
to
7388f56
Compare
This change ensures that we check configs when loading them through `filebeat.config.modules`, `filebeat.config.prospectors` or `metricbeat.config.modules`. It will error and exit if settings are wrong and **reload is disabled**
7388f56
to
222ee2c
Compare
Please note that it conflicts with my PR #5026, so one of us will have to rebase their branch after merging. :) |
done: make(chan struct{}), | ||
} | ||
} | ||
|
||
// Check configs are valid (only if reload is disabled) | ||
func (rl *Reloader) Check(runnerFactory RunnerFactory) error { |
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.
It is quite similar to the existing config reload code in Run
function. I would extract anything that could be extracted into smaller functions. So those could be reused it in both Check
and Run
. Thus, code duplication could be eliminated.
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'll do some refactoring, thanks!
I have one concerns regarding the code. I have already accepted your PR, so decide if you would address it or not. |
This should be ready for a second look |
After it turns green, I would merge it. |
* Check modules and prospectors settings when reload is off This change ensures that we check configs when loading them through `filebeat.config.modules`, `filebeat.config.prospectors` or `metricbeat.config.modules`. It will error and exit if settings are wrong and **reload is disabled** * Extract common operations from check and start (cherry picked from commit 4c17368)
) * Check modules and prospectors settings when reload is off This change ensures that we check configs when loading them through `filebeat.config.modules`, `filebeat.config.prospectors` or `metricbeat.config.modules`. It will error and exit if settings are wrong and **reload is disabled** * Extract common operations from check and start (cherry picked from commit 4c17368)
…) (elastic#5107) * Check modules and prospectors settings when reload is off This change ensures that we check configs when loading them through `filebeat.config.modules`, `filebeat.config.prospectors` or `metricbeat.config.modules`. It will error and exit if settings are wrong and **reload is disabled** * Extract common operations from check and start (cherry picked from commit ac3d0dd)
This change ensures that we check configs when loading them through
filebeat.config.modules
,filebeat.config.prospectors
ormetricbeat.config.modules
.It will error and exit if settings are wrong and reload is disabled
Part of #4810