@@ -37,8 +37,9 @@ module WipeCluster8
37
37
'synthetics' , 'synthetics-settings' , 'synthetics-mappings' ,
38
38
'.snapshot-blob-cache' , '.deprecation-indexing-template' ,
39
39
'.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'
42
43
] . freeze
43
44
44
45
# Wipe Cluster, based on PHP's implementation of ESRestTestCase.java:wipeCluster()
@@ -64,11 +65,7 @@ def wipe_cluster(client)
64
65
wipe_snapshots ( client )
65
66
wipe_datastreams ( client )
66
67
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 )
72
69
wipe_cluster_settings ( client )
73
70
if platinum?
74
71
clear_ml_jobs ( client )
@@ -210,7 +207,7 @@ def wipe_all_indices(client)
210
207
client . indices . delete ( index : '*,-.ds-ilm-history-*' , expand_wildcards : 'open,closed,hidden' , ignore : 404 )
211
208
end
212
209
213
- def wipe_templates_for_xpack ( client )
210
+ def wipe_all_templates ( client )
214
211
templates = client . indices . get_index_template
215
212
216
213
templates [ 'index_templates' ] . each do |template |
@@ -242,18 +239,11 @@ def wipe_templates_for_xpack(client)
242
239
end
243
240
end
244
241
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
-
255
242
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
257
247
platinum_prefixes . map { |a | return true if a . include? template }
258
248
259
249
PLATINUM_TEMPLATES . include? template
0 commit comments