-
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
Refactor export and idxmgmt handling. #11777
Conversation
Change idxmgmt handling to work with esClient and stdoutClient, and change supporter interface for more flexibility. Refactor export cmds to reuse some logic.
@urso this is ready for another round of review. |
genTemplateConfigCmd.Flags().Bool("noilm", false, "Generate template with ILM disabled") | ||
genTemplateConfigCmd.Flags().String("dir", "", "Specify directory for printing template files. By default templates are printed to stdout.") |
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.
nice. Makes me wonder if it would make sense to have this as a positional parameter instead of a CLI flag. E.g. what happens when we introduce multiple templates support, where to write to if no dir is given?
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.
If no dir is given, we write to stdout.
Jenkins, please test this. |
Jenkins, test this. |
jenkins, test this. |
At the moment one
idxmgmt.Supporter
and oneilm.Supporter
can be defined for one beat, with the following interfaces:idxmgmt.Supporter:
ilm.Supporter and ilm.Manager:
Using these interfaces as is does not allow for having multiple templates nor multiple ILM policies for one beat. This is a requirement for APM though.
During some discussion with @urso we agreed on moving forward by allowing for having multiple ILM supporter per idxmgmt supporter, and abstracting away the template handling. This can be achieved by removing following from the
idxmgmt.Supporter
interface:The main changes arising from this is related to the
export
commands, as they were using those methods.Therefore this PR addresses two main points:
idxmgmt.Supporter
to allow for multiple ilm supporter and more flexible template handlingexport template
andexport ilm-policy
cmds and refactorexport
package to reuse and align more logic. Exporting templates and ilm-policy also allows to specify a--dir
option now so one can write them to a file in a specified directory.TODO: