Skip to content

Commit 9d5395e

Browse files
authored
Properly handle wildcards in data stream deletion requests (#78463)
1 parent 448eb50 commit 9d5395e

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/action/DeleteDataStreamTransportAction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ protected void masterOperation(
8686
for (String name : names) {
8787
systemIndices.validateDataStreamAccess(name, threadPool.getThreadContext());
8888
}
89-
request.indices(names.toArray(Strings.EMPTY_ARRAY));
9089

9190
clusterService.submitStateUpdateTask(
9291
"remove-data-stream [" + Strings.arrayToCommaDelimitedString(request.getNames()) + "]",

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/data_stream/10_basic.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,43 @@ setup:
403403
indices.delete_data_stream:
404404
name: simple-data-stream2
405405

406+
---
407+
"Delete data stream by wildcard":
408+
- skip:
409+
version: " - 7.99.99"
410+
reason: "change to [-7.8.99] and [data streams only supported in 7.9+] after backport"
411+
412+
- do:
413+
indices.create_data_stream:
414+
name: simple-data-stream1
415+
- is_true: acknowledged
416+
417+
- do:
418+
indices.create_data_stream:
419+
name: simple-data-stream2
420+
- is_true: acknowledged
421+
422+
- do:
423+
indices.delete_data_stream:
424+
name: no-matching-data-streams*
425+
- is_true: acknowledged
426+
427+
- do:
428+
indices.get_data_stream:
429+
name: "*"
430+
- match: { data_streams.0.name: simple-data-stream1 }
431+
- match: { data_streams.1.name: simple-data-stream2 }
432+
433+
- do:
434+
indices.delete_data_stream:
435+
name: simple-data-stream*
436+
- is_true: acknowledged
437+
438+
- do:
439+
indices.get_data_stream:
440+
name: "*"
441+
- length: { data_streams: 0 }
442+
406443
---
407444
"append-only writes to backing indices prohibited":
408445
- skip:

0 commit comments

Comments
 (0)