allow configuring ELASTIC_INDEX for elastic_stats command
#374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows the
indexNameto be configured when executing thepelias elastic statscommand.@arnesetzer sorry for all the back-and-forth on this, considering that the scope for this feature is fairly narrow (ie. blue green deployments) I would prefer not to complicate things too much by doing a bunch of refactoring, the
cmd/elastic.shscript has an established method of overloading the defaults (ELASTIC_HOST) so adopting that method allows us to achieve the desired result by simply introducingELASTIC_INDEX.The ergonomics are maybe not as aesthetically pleasing as using command-line flags, but I don't want to introduce a change where some commands use env vars while others use flags, and this one using a mix of the two.
Again sorry for my poor direction on this, it took me a while to figure out.
closes #371
closes #372
closes pelias/schema#507