Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deprecation warning for API call 'GET _cat/master' in 'ExceptionIT' of mixed cluster BWC test #2767

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ public void testOpensearchException() throws Exception {
private void logClusterNodes() throws IOException {
ObjectPath objectPath = ObjectPath.createFromResponse(client().performRequest(new Request("GET", "_nodes")));
Map<String, ?> nodes = objectPath.evaluate("nodes");
String master = EntityUtils.toString(client().performRequest(new Request("GET", "_cat/master?h=id")).getEntity()).trim();
logger.info("cluster discovered: master id='{}'", master);
// As of 2.0, 'GET _cat/master' API is deprecated to promote inclusive language.
// Allow the deprecation warning for the node running an older version.
// TODO: Replace the API with 'GET _cat/cluster_manager' when dropping compatibility with 1.x versions.
Request catRequest = new Request("GET", "_cat/master?h=id");
catRequest.setOptions(expectWarningsOnce("[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead."));
String clusterManager = EntityUtils.toString(client().performRequest(catRequest).getEntity()).trim();
logger.info("cluster discovered: cluster-manager id='{}'", clusterManager);
for (String id : nodes.keySet()) {
logger.info("{}: id='{}', name='{}', version={}",
objectPath.evaluate("nodes." + id + ".http.publish_address"),
Expand Down