Skip to content

Commit d3a8bb7

Browse files
committed
[CI] Updates wipe cluster
1 parent 5ad2876 commit d3a8bb7

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

api-spec-testing/wipe_cluster_8.rb

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ module WipeCluster8
3737
'synthetics', 'synthetics-settings', 'synthetics-mappings',
3838
'.snapshot-blob-cache', '.deprecation-indexing-template',
3939
'.deprecation-indexing-mappings', '.deprecation-indexing-settings',
40-
'security-index-template', 'data-streams-mappings',
41-
'behavioral_analytics-events-mappings', 'behavioral_analytics-events-settings'
40+
'behavioral_analytics-events-mappings', 'behavioral_analytics-events-settings',
41+
'security-index-template', 'data-streams-mappings', 'ecs@dynamic_templates',
42+
'search-acl-filter'
4243
].freeze
4344

4445
# Wipe Cluster, based on PHP's implementation of ESRestTestCase.java:wipeCluster()
@@ -64,11 +65,7 @@ def wipe_cluster(client)
6465
wipe_snapshots(client)
6566
wipe_datastreams(client)
6667
wipe_all_indices(client)
67-
if platinum?
68-
wipe_templates_for_xpack(client)
69-
else
70-
wipe_all_templates(client)
71-
end
68+
wipe_all_templates(client)
7269
wipe_cluster_settings(client)
7370
if platinum?
7471
clear_ml_jobs(client)
@@ -210,7 +207,7 @@ def wipe_all_indices(client)
210207
client.indices.delete(index: '*,-.ds-ilm-history-*', expand_wildcards: 'open,closed,hidden', ignore: 404)
211208
end
212209

213-
def wipe_templates_for_xpack(client)
210+
def wipe_all_templates(client)
214211
templates = client.indices.get_index_template
215212

216213
templates['index_templates'].each do |template|
@@ -242,18 +239,11 @@ def wipe_templates_for_xpack(client)
242239
end
243240
end
244241

245-
def wipe_all_templates(client)
246-
client.indices.delete_template(name: '*')
247-
begin
248-
client.indices.delete_index_template(name: '*')
249-
client.cluster.delete_component_template(name: '*')
250-
rescue StandardError => e
251-
logger.info('Using a version of ES that doesn\'t support index templates v2 yet, so it\'s safe to ignore')
252-
end
253-
end
254-
255242
def platinum_template?(template)
256-
platinum_prefixes = ['.monitoring', '.watch', '.triggered-watches', '.data-frame', '.ml-', '.transform', 'data-streams-mappings'].freeze
243+
platinum_prefixes = [
244+
'.monitoring', '.watch', '.triggered-watches', '.data-frame', '.ml-', '.transform',
245+
'data-streams-mappings'
246+
].freeze
257247
platinum_prefixes.map { |a| return true if a.include? template }
258248

259249
PLATINUM_TEMPLATES.include? template

0 commit comments

Comments
 (0)