Skip to content

Commit a8d7322

Browse files
authored
Fix p0=deprecation/10_basic/Test Deprecations (#125687) (#125769)
In #120505 we introduced a capabilities check in the yaml test `deprecation/10_basic/Test Deprecations` but we forgot to add them in the `RestDeprecationInfoAction`. In this PR we add the capabilities which will enable the test and we make the test resilient to the warning that occurs when the `.security-7` index is present.
1 parent e05d4cf commit a8d7322

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java

+8
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717

1818
import java.io.IOException;
1919
import java.util.List;
20+
import java.util.Set;
2021

2122
import static org.elasticsearch.rest.RestRequest.Method.GET;
2223

2324
public class RestDeprecationInfoAction extends BaseRestHandler {
2425

26+
private static final Set<String> SUPPORTED_CAPABILITIES = Set.of("data_streams", "ilm_policies", "templates");
27+
2528
@Override
2629
public List<Route> routes() {
2730
return List.of(
@@ -53,4 +56,9 @@ private static RestChannelConsumer handleGet(final RestRequest request, NodeClie
5356
);
5457
return channel -> client.execute(DeprecationInfoAction.INSTANCE, infoRequest, new RestToXContentListener<>(channel));
5558
}
59+
60+
@Override
61+
public Set<String> supportedCapabilities() {
62+
return SUPPORTED_CAPABILITIES;
63+
}
5664
}

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ setup:
1111
- method: GET
1212
path: /_migration/deprecations
1313
capabilities: [ data_streams, ilm_policies, templates ]
14-
test_runner_features: capabilities
14+
test_runner_features: [capabilities, allowed_warnings]
1515
reason: "Support for data streams, ILM policies and templates"
1616
- do:
17+
allowed_warnings:
18+
- "this request accesses system indices: [.security-7], but in a future major version, direct access to system indices will be prevented by default"
1719
migration.deprecations:
1820
index: "*"
1921
- length: { cluster_settings: 0 }

0 commit comments

Comments
 (0)