From c3f9839c2c74ad2b45c5c885ccc396b1f42e5e77 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 17 Oct 2024 16:58:42 +0400 Subject: [PATCH] Delete less system templates/policies --- test_elasticsearch/utils.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test_elasticsearch/utils.py b/test_elasticsearch/utils.py index 183b7b0dc..4a26aa4c0 100644 --- a/test_elasticsearch/utils.py +++ b/test_elasticsearch/utils.py @@ -281,6 +281,9 @@ def wipe_ilm_policies(client): ".monitoring-8-ilm-policy", } and "-history-ilm-polcy" not in policy + and "-meta-ilm-policy" not in policy + and "-data-ilm-policy" not in policy + and "@lifecycle" not in policy ): client.ilm.delete_lifecycle(name=policy) @@ -408,11 +411,7 @@ def wait_for_cluster_state_updates_to_finish(client, timeout=30): def is_xpack_template(name): - if name.startswith(".alerts-"): - return True - elif name.startswith(".kibana-data-quality-dashboard-"): - return True - elif name.startswith(".kibana-elastic-ai-assistant-component-template-"): + if name.startswith("."): return True elif name.startswith("behavioral_analytics-events"): return True @@ -420,7 +419,9 @@ def is_xpack_template(name): return True elif name.startswith("entities_v1_"): return True - elif name.startswith(".deprecation-"): + elif name.endswith("@ilm"): + return True + elif name.endswith("@template"): return True return name in { @@ -432,15 +433,19 @@ def is_xpack_template(name): "apm@settings", "data-streams-mappings", "data-streams@mappings", + "elastic-connectors", "ecs@dynamic_templates", "ecs@mappings", + "ilm-history-7", "kibana-reporting@settings", + "logs", "logs-apm.error@mappings", "logs-apm@settings", "logs-mappings", "logs@mappings", "logs-settings", "logs@settings", + "metrics", "metrics-apm@mappings", "metrics-apm.service_destination@mappings", "metrics-apm.service_summary@mappings", @@ -453,6 +458,8 @@ def is_xpack_template(name): "metrics@settings", "metrics-tsdb-settings", "metrics@tsdb-settings", + "search-acl-filter", + "synthetics", "synthetics-mappings", "synthetics@mappings", "synthetics-settings",