-
Notifications
You must be signed in to change notification settings - Fork 529
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
fix: move beats cfgfile.HandleFlags call after the flags are parsed #14512
Conversation
LGTM |
652b284
to
f1dc8a4
Compare
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.
LGTM
did a quick test on my end. tested with and without apm-server.yml
in the directory and everything worked fine.
Tested with -E management.enabled=true
and apm server correctly waited for it's config on stdin.
Tested with ./apm-server -E management.enabled=false -E logging.leve=debug --E logging.to_stderr=true --memprofile -1s -c ./apm-server.yml.bk
and it found correct config file, wrote the memprofile to the file called "-1s", and correct debug level to stderr.
…14512) (#14537) * fix: move beats cfgfile.HandleFlags call after the flags are parsed * fix: beats call to ConvertFlagsForBackwardsCompatibility on init * fix: beatcmd add remaining flag into backward compatibble flags list (cherry picked from commit e2c0fb5) Co-authored-by: Kostiantyn Masliuk <[email protected]>
Motivation/summary
This PR fixes the issue with flags parsing in APM Server beats cmd. By moving
cfgfile.HandleFlags
to after the point when the flags are parsed by the cobra cli.Checklist
For functional changes, consider:
How to test these changes
Build a snapshot EA image for ESS and run it.
Related issues
elastic/elastic-agent#589