Skip to content

Commit e39f80b

Browse files
authored
Fix p0=deprecation/10_basic/Test Deprecations (#125687) (#125770)
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 6ba6caf commit e39f80b

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616

1717
import java.io.IOException;
1818
import java.util.List;
19+
import java.util.Set;
1920

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

2223
public class RestDeprecationInfoAction extends BaseRestHandler {
2324

25+
private static final Set<String> SUPPORTED_CAPABILITIES = Set.of("data_streams", "ilm_policies", "templates");
26+
2427
@Override
2528
public List<Route> routes() {
2629
return List.of(new Route(GET, "/_migration/deprecations"), new Route(GET, "/{index}/_migration/deprecations"));
@@ -47,4 +50,9 @@ private static RestChannelConsumer handleGet(final RestRequest request, NodeClie
4750
);
4851
return channel -> client.execute(DeprecationInfoAction.INSTANCE, infoRequest, new RestToXContentListener<>(channel));
4952
}
53+
54+
@Override
55+
public Set<String> supportedCapabilities() {
56+
return SUPPORTED_CAPABILITIES;
57+
}
5058
}

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

Lines changed: 3 additions & 1 deletion
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)