diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index 164f0ec77b146..e2ac51558d503 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -38,6 +38,7 @@ private DeprecationChecks() { static List, List, DeprecationIssue>> NODE_SETTINGS_CHECKS = Collections.unmodifiableList(Arrays.asList( + NodeDeprecationChecks::httpEnabledSettingRemoved, NodeDeprecationChecks::tribeNodeCheck, NodeDeprecationChecks::azureRepositoryChanges, NodeDeprecationChecks::gcsRepositoryChanges, diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java index 71da6cddfe8f2..8a45c4e3edf0a 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java @@ -8,6 +8,7 @@ import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; +import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import java.util.List; @@ -18,6 +19,21 @@ */ public class NodeDeprecationChecks { + static DeprecationIssue httpEnabledSettingRemoved(List nodeInfos, List nodeStats) { + List nodesFound = nodeInfos.stream() + .filter(nodeInfo -> nodeInfo.getSettings().hasValue(NetworkModule.HTTP_ENABLED.getKey())) + .map(nodeInfo -> nodeInfo.getNode().getName()) + .collect(Collectors.toList()); + if (nodesFound.size() > 0) { + return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "HTTP Enabled setting removed", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" + + "#remove-http-enabled", + "nodes with http.enabled set: " + nodesFound); + } + return null; + } + static DeprecationIssue tribeNodeCheck(List nodeInfos, List nodeStats) { List nodesFound = nodeInfos.stream() .filter(nodeInfo -> nodeInfo.getSettings().getByPrefix("tribe.").isEmpty() == false) diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java index 39641339d28a6..55893949fe13f 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecksTests.java @@ -59,6 +59,15 @@ null, null, null, null, new FsInfo(0L, null, paths), null, null, null, assertEquals(singletonList(expected), issues); } + public void testHttpEnabledCheck() { + DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "HTTP Enabled setting removed", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking_70_cluster_changes.html" + + "#remove-http-enabled", + "nodes with http.enabled set: [node_check]"); + assertSettingsAndIssue("http.enabled", Boolean.toString(randomBoolean()), expected); + } + public void testTribeNodeCheck() { String tribeSetting = "tribe." + randomAlphaOfLengthBetween(1, 20) + ".cluster.name"; DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,