From 56b0070e5ccfb39d7cb8590784462359f0f8cf6f Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Tue, 23 Jul 2019 14:56:43 -0500 Subject: [PATCH] [Heartbeat] Whitelist --index-management flag for heartbeat (#13016) * [Heartbeat] Whitelist --index-management flag for heartbeat We received a bug report on [discuss](https://discuss.elastic.co/t/heartbeat-7-2-0-error-unknown-flag-index-management/191670) about this key being missing. It should have been added with https://github.com/elastic/beats/pull/11856 but was missed. * Deprecate old keys (cherry picked from commit d43ec5eba9020bdc58e016c1629cf96ac0261697) --- heartbeat/cmd/root.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/heartbeat/cmd/root.go b/heartbeat/cmd/root.go index 6dee7e2a94b3..99cd9e5d4be9 100644 --- a/heartbeat/cmd/root.go +++ b/heartbeat/cmd/root.go @@ -18,6 +18,7 @@ package cmd import ( + "fmt" // register default heartbeat monitors "github.com/elastic/beats/heartbeat/beater" _ "github.com/elastic/beats/heartbeat/monitors/defaults" @@ -49,6 +50,9 @@ func init() { * ILM Policy ` setup.ResetFlags() + setup.Flags().Bool(cmd.IndexManagementKey, false, "Setup all components related to Elasticsearch index management, including template, ilm policy and rollover alias") + setup.Flags().MarkDeprecated(cmd.TemplateKey, fmt.Sprintf("use --%s instead", cmd.IndexManagementKey)) + setup.Flags().MarkDeprecated(cmd.ILMPolicyKey, fmt.Sprintf("use --%s instead", cmd.IndexManagementKey)) setup.Flags().Bool(cmd.TemplateKey, false, "Setup index template") setup.Flags().Bool(cmd.ILMPolicyKey, false, "Setup ILM policy") }