Skip to content

Commit

Permalink
Delete less system templates/policies
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Oct 17, 2024
1 parent 720ad1e commit c3f9839
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions test_elasticsearch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -408,19 +411,17 @@ 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
elif name.startswith("elastic-connectors-"):
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 {
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit c3f9839

Please sign in to comment.