File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
tests/Elasticsearch/Tests Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 20
20
21
21
use Elasticsearch \Client ;
22
22
use Elasticsearch \ClientBuilder ;
23
+ use Elasticsearch \Common \Exceptions \ElasticsearchException ;
23
24
use Elasticsearch \Common \Exceptions \Missing404Exception ;
24
25
25
26
class Utility
@@ -319,10 +320,15 @@ private static function wipeTemplateForXpack(Client $client): void
319
320
if (self ::isXPackTemplate ($ component ['name ' ])) {
320
321
continue ;
321
322
}
322
- $ client ->cluster ()->deleteComponentTemplate ([
323
- 'name ' => $ component ['name ' ]
324
- ]);
323
+ try {
324
+ $ client ->cluster ()->deleteComponentTemplate ([
325
+ 'name ' => $ component ['name ' ]
326
+ ]);
327
+ } catch (ElasticsearchException $ e ) {
328
+ // We hit a version of ES that doesn't support index templates v2 yet, so it's safe to ignore
329
+ }
325
330
}
331
+
326
332
}
327
333
328
334
/**
You can’t perform that action at this time.
0 commit comments