From 22c991ab2b0c19fa88400293417e5752144f8fcf Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Mon, 22 Jul 2019 11:17:37 -0500 Subject: [PATCH 1/2] [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. --- heartbeat/cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/heartbeat/cmd/root.go b/heartbeat/cmd/root.go index 6dee7e2a94b3..5b0aa8f05adc 100644 --- a/heartbeat/cmd/root.go +++ b/heartbeat/cmd/root.go @@ -49,6 +49,7 @@ 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().Bool(cmd.TemplateKey, false, "Setup index template") setup.Flags().Bool(cmd.ILMPolicyKey, false, "Setup ILM policy") } From b3a3eb3a82744272c48e41f76f4a28c5f2f245e3 Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Mon, 22 Jul 2019 14:24:14 -0500 Subject: [PATCH 2/2] Deprecate old keys --- heartbeat/cmd/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/heartbeat/cmd/root.go b/heartbeat/cmd/root.go index 5b0aa8f05adc..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" @@ -50,6 +51,8 @@ func init() { ` 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") }